why does this fail on python 2.2?

Robert Brewer fumanchu at amor.org
Mon Aug 30 11:13:52 EDT 2004


John Hunter wrote:
> class Results(object):
>     __slots__ = ( "__doinit" )
>     def __new__(cls):
>         retobj = object.__new__(cls)
>         retobj.__doinit = True
>         return retobj

Not sure why that fails, but I am wondering why you chose:

retobj = object.__new__(cls)

over:

retobj = cls()

Perhaps you're "digging too deep" on the supercall.


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org



More information about the Python-list mailing list