PEP 235: role of PyType_GenericNew()

Gustavo Niemeyer niemeyer at conectiva.com
Wed Apr 3 12:27:54 EST 2002


Hi Ralf!

> I'm wondering whether the current implementation of PyType_GenericNew
> does, what it's supposed to do.
[...]
> Thus, only the allocator of the passed type is called.
> Shouldn't the base classes allocators be called as well?

If you're inheriting from another object, and you don't want to
do anything special at object initialization time, why would you
use this function in the first place? Just leave the slot empty
and allow the super class to initialize itself. If you implement
your special function, it's your business to call the super class.

Best regards!

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]





More information about the Python-list mailing list