0
Why would you use super() like this? What does it actually do?
class Myclass: def __init__(self, item): super().__init__()
8 Respuestas
+ 2
Thanks everyone, for the help and answers. Deleted the super() line and the code is stil going 100%...
+ 1
I don’t think it makes any sense to use `super` when there is no inheritance of class.
+ 1
agree with o.gak , super() is to be used only if you want to call the properties/ methods of the parent class. Without a parent class it is purposeless
0
It should be like this.
class MyClass(ParentCls):
def __init__(self, prop_of_parent, prop_of_mine):
super().__init__(prop_of_parent)
self. prop_of_mine = prop_of_mine
0
There is NO parent class. Myclass is the only class in the code...
0
I know that one class can inherit from another class, but this is not the case.... See the fulk code
https://code.sololearn.com/c50xf0qK6C42/?ref=app
0
Actually all classes in Python inherit from class Object how I remember. So... This class in any case should have parents.
Or do i remember it wrong?