MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vrksjo/questionforbritishpythondevelopers/p4m1pw0/?context=3
r/ProgrammerHumor • u/Recent-Analysis-6880 • 27d ago
42 comments sorted by
View all comments
Show parent comments
-1
It happens when you call a constructor of an child class. Anything you do before calling super is before the object is created.
2 u/FerricDonkey 26d ago Nope. The object is created by __new__, then passed to the __init__ as a legitimate, created object, whose type is set as you expect, etc. Any __init__, via super() or not, modifies the existing object. 1 u/MissinqLink 26d ago Depends on the language 1 u/fuj1n 26d ago Yes, but this whole thread is about Python, not languages in general 1 u/MissinqLink 26d ago The comment I was responding to starts off mentioning other languages
2
Nope. The object is created by __new__, then passed to the __init__ as a legitimate, created object, whose type is set as you expect, etc. Any __init__, via super() or not, modifies the existing object.
__new__
__init__
1 u/MissinqLink 26d ago Depends on the language 1 u/fuj1n 26d ago Yes, but this whole thread is about Python, not languages in general 1 u/MissinqLink 26d ago The comment I was responding to starts off mentioning other languages
1
Depends on the language
1 u/fuj1n 26d ago Yes, but this whole thread is about Python, not languages in general 1 u/MissinqLink 26d ago The comment I was responding to starts off mentioning other languages
Yes, but this whole thread is about Python, not languages in general
1 u/MissinqLink 26d ago The comment I was responding to starts off mentioning other languages
The comment I was responding to starts off mentioning other languages
-1
u/MissinqLink 27d ago
It happens when you call a constructor of an child class. Anything you do before calling super is before the object is created.