Skip to content

re: Get parent class in Python? VIEW POST


Wow, I never would've guessed you can define classes inside classes in Python... how does that even work? What are you trying to accomplish?

element.parentNode has nothing to do with classes, it just gives you the object that contains this one in the DOM.


I'm not sure that the example in the post works, but if it does, I suspect you end up with the 'sub-classes' bound to the containing class as class attributes, not as classes which inherit from the containing class.


Yea, in most OOP languages you can have sub-classes that's what _ and __ prefixes are for

code of conduct - report abuse