def __init__(self):

Random832 random832 at fastmail.com
Tue Apr 26 09:49:22 EDT 2016


On Tue, Apr 26, 2016, at 03:34, Ben Finney wrote:
> That's needlessly confusing: ‘__init__’ is not a constructor because it
> does not construct the instance. The ‘__new__’ method is the constructor
> for a class (and returns the new instance).

the __new__ method is the *allocator*. "constructor" is used in many
languages to name a method that initializes an object once it already
"exists". Saying you can't call it that in Python is needlessly
confusing.



More information about the Python-list mailing list