[ZODB-Dev] Persistent-derived class instances always callable

Shane Hathaway shane at zope.com
Fri Oct 17 18:04:44 EDT 2003


[Shane]
> > callable() doesn't go to the effort of discerning the difference, so it
> > always returns True for ExtensionClass instances.

[Tim]
> If that's undesirable, it shouldn't set tp_call all the time <wink>.

Checking tp_call is insufficient.  Objects should have the opportunity to 
tell callable() whether or not they are callable.  Depending on tp_call 
means that the callability decision is made by the type of the object 
rather than the object itself.

Checking for the __call__ attribute may not be the best approach (since it
has demonstrated flaws), but we need something better than relying on
tp_call.

Shane



More information about the ZODB-Dev mailing list