__init__ explanation please
Steven D'Aprano
steve at REMOVE-THIS-cybersource.com.au
Mon Jan 14 16:21:43 EST 2008
On Mon, 14 Jan 2008 22:18:44 +1100, Ben Finney wrote:
> What one is "in reality" calling is the '__new__' method of the Person
> class. That function, in turn, is creating a new Person instance, and
> calling the '__init__' method of the newly-created instance. Finally,
> the '__new__' method returns that instance back to the caller.
But not if Person is an old-style class.
--
Steven
More information about the Python-list
mailing list