Andrew McLane3,385 Points
need help with understanding super() use.
So I need help understanding a couple of things:
I understand that a class without a specified parent class always has python's parent class of 'object'. However, why do we need to use super. Thought this was so taht we could borrow a paren'ts initialization method, but here we aren't even using arguments (in the first part of the video).
I thought the parenthesis for a subclass was used to specify the name of a parent class, but here we use 'list'. I'm not sure I understand how we are allowed to do this, and how python differentiates between a class parent name and a type argument.
Ryan Cross5,738 Points
1 One of the important things children get from super().init() are the parents methods. List has append , extend etc. Without super()init() you would either not have any of those or have to design/build them if you needed them.
2 List is a class. its true its a built in class like string or tuple but none the less it is a class. It has object as a parent and it can have children. Here we make a class based on list. list is a parent to Hand.