Re: Python 2.6 Deprecation Warnings with __new__ — Can someone expla in why?

2009-10-26 Thread Terry Reedy
Carl Banks wrote: So what is the point of using __new__? .__new__ creates new objects. It also inializes 'immutable' objects. It's mostly for types written in C, or for subclassing types written in C. Specifically, for subclassing immutable classes where one wants initialization behavior

Re: Python 2.6 Deprecation Warnings with __new__ — Can someone expla in why?

2009-10-23 Thread Terry Reedy
Consider this: def blackhole(*args, **kwds): pass The fact that it accept args that it ignores could be considered misleading or even a bug. Now modify it to do something useful, like return a new, naked, immutable object that is the same for every call except for identity, and which still t