Classes must explicitly inherit from object to call __new__ . Override Client , so it looks like this:
class Client(object): def __new__(cls): print "NEW" return cls def __init__(self): print "INIT"
__new__ will now be called when used as:
cl = Client()
Note that __init__ will never be called in this situation, since __new__ does not call the __new__ superclass as the return value.
Hach-que
source share