◐ Shell
clean mode source ↗

Message 67994 - Python tracker

On 2008-06-11 16:49, Nick Coghlan wrote:
> Nick Coghlan <ncoghlan@gmail.com> added the comment:
> 
> I'm not sure adding a dedicated method slot would be worth the hassle
> involved - Py3k drop backs to just the tp_str slot anyway, and the only
> thing you gain with a tp_unicode slot over _PyType_Lookup of a
> __unicode__ attribute is a small reduction in memory usage and a slight
> speed increase.

AFAIK, _PyType_Lookup will only work for base types, ie. objects
subclassing from object. C extension types often do not inherit from
object, since the attribute access mechanisms and object creation
are a lot simpler when not doing so.