I'm considering if there is a way to use inherit with super() in Python3 but ignore part of the method? I can show you an example below.
Let's say I have class that initialize some RPi GPIOs
class Encoder(object):
def __init__(self, A, B):
GPIO.setmode(GPIO.BCM)
GPIO.setup(A, GPIO.IN)
GPIO.setup(B, GPIO.IN)
self.A = A
self.B = B
I would like to inherit this class and its init() method, but I would like to change GPIO.setmode(GPIO.BCM) to GPIO.setmode(GPIO.BOARD). Is there a way to do it without copy whole __init__ into my child class?
It is not a big deal to just copy it with change in this one line, but I'm curious if it is possible to avoid copy-pasting ;)