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
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