The type.__call__() method manages the calls to __new__ and __init__?

2012-11-20 Thread Marco
Looking at the documentation of Py3.3: http://docs.python.org/3.3/reference/datamodel.html#object.__new__ I saw the method `__new__()` is called automatically when I create an istance. After the call to __new__(), if it returns an instance `self` then `self.__init__()` is called. Because

Re: The type.__call__() method manages the calls to __new__ and __init__?

2012-11-20 Thread Ian Kelly
On Tue, Nov 20, 2012 at 10:29 AM, Marco name.surn...@gmail.com wrote: Because when I call an instance the __call__ method is called, and because the classes are instances of type, I thought when I call a Foo class this imply the call type.__call__(Foo), and so this one manages the Foo.__new__