[Zope3-dev] Re: TALES PathExpr doesn't call old style classes
Philipp von Weitershausen
philipp at weitershausen.de
Wed May 24 12:16:55 EDT 2006
Florent Guillaume wrote:
> Philipp von Weitershausen wrote:
>> Hi there,
>>
>> I've filed an issue in the collector outlining a problem with old style
>> classes and TALES traversal: http://www.zope.org/Collectors/Zope3-dev/635
>>
>> In particular, I'm looking for comments on problem #2.
>
> Well, following the mantra of "explicit is better than implicit" I'd
> rather have ZPT never call things magically, but I know that's not the
> problem at hand and it poses backward compat problems anyway... Too bad
> though.
Yup. We could think about this for some future release cycle, though.
I'd very much be in favour of making nocall: the default and introduce
something like call:. Then sniffing for callableness wouldn't be necessary.
> For #2 I'd just do a check that type(C) is classobj, even though this
> doesn't take care of proxied old-style classes (who uses those anyway?).
I guess that'd be ok.
> BTW your comment in the patch about getattr(ob, '__call__', _marker)
> triggering acquisition isn't really true, as attributes starting with
> '_' are never looked up by an implicit acquisition wrapper (although you
> can still ask for them explicitely by using aq_acquire).
Ah good, to know. I added this remark and your suggestion above to the
issue transcript. I will commit a patch later this week.
Philipp
More information about the Zope3-dev
mailing list