python inheritance Flashcards

1
Q

what does super() do?

A

allows the child to access parent methods and properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how can a child override parent method implementation?

A

just define the same method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is the @staticmethod decorator?

A

This is a defined decorator that will not modify the state of a class or method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

when is it helpful to use @staticmethod ?

A

when it makes sense to group a method with a class, but the method doesn’t modify the state of the class or instance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly