[Python-checkins] r63761 - in python/branches/okkoto-sizeof: Lib/test/test_sys.py Objects/typeobject.c Python/sysmodule.c

Robert Schuppenies okkotonushi at googlemail.com
Thu May 29 15:01:45 CEST 2008


Nick Coghlan wrote:
> The way to avoid this confusion is to invoke type(obj).__sizeof__(obj)
> rather than attempting to invoke obj.__sizeof__() directly.
> 
> I'd suggest seeing how you go with changing __sizeof__ back to a normal
> method and implementing the C equivalent of type(obj).__sizeof__(obj) to
> actually make the method call in sys_getsizeof (see PyObject_Format in
> Objects/abstract.c for an example of how to do this).

Works like a charm, thanks for the hint.

Also for pointing me to this list, I wasn't aware that somebody is
watching my moves. I'll try to adapt my submit policy to this fact.

thanks,
robert


More information about the Python-checkins mailing list