4 ms·
Again, this is what I'm talking about. If you don't know the exact details, why do you want to teach how it works? Learn it first, try it, THEN teach about it.
by kissgyorgy 5y ago
Again, this is what I'm talking about. If you don't know the exact details, why do you want to teach how it works? Learn it first, try it, THEN teach about it. Silence or questions arebetter when you don't exactly know how things work.
__new__ doesn't call __init__, the interpreter will call the __init__ when an instance is returned from __new__, otherwise it won't even be called.
- teh_klev 5y agoOk, mea culpa. However... In the __new__ method docs they mention an "object constructor expression" which I take to mean: person = Person("Bob", "Smith") And in the __init__ method docs there's mention of a "class constructor expression" which I also take to mean the same as above. Yet oddly we have no mention of constructors or constructor expressions in: https://docs.python.org/3/tutorial/classes.html https://docs.python.org/3/tutorial/classes.html And the act of instantiating a new instance of a class is referred to as "“calling” a class object)" https://docs.python.org/3/tutorial/classes.html#class-objects https://docs.python.org/3/tutorial/classes.html#class-object... Would you not agree that the docs could be a bit more consistent with regards to terminology?
- deleted 5y ago[deleted]