super()
Calls a method from the parent class (following the MRO).
Easy
class Led(Component):
def __init__(self, pin):
super().__init__(name="LED")
self.pin = pin
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.