-
Notifications
You must be signed in to change notification settings - Fork 0
Super
Vinicius Reif Biavatti edited this page Jul 25, 2022
·
1 revision
- Always use
super()
function to access parent resources - Using
super()
it ensures that the MRO (Method Resolution Order) will be used to determinate the inheritance order
✅ Do
class House(Building):
def __init__(self, name: str) -> None:
super().__init__(name)
❌ Don't
class House(Building):
def __init__(self, name: str) -> None:
Building.__init__(self, name)
- Home
- Structural Naming Conventions
- Format Conventions
- Code Naming Conventions
- Inheritance
- Access Modifiers
- Importation
- Functions and Methods
- Documentation
- Resources