Skip to content
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)
Clone this wiki locally