I think it'd be useful to automatically unexport previously used pins.
Since a pin is in your case a normal Python object of Pin class its __del__ method
can be used to perform this task. This way pin will be freed during object's destruction.
Something along these lines;
class Pin(object):
# [...]
def __del__(self):
self.unexport()
There is obviously an issue when sb creates multiple instances of Pin objects referencing the same hardware pin.
I think it'd be useful to automatically unexport previously used pins.
Since a pin is in your case a normal Python object of
Pinclass its__del__methodcan be used to perform this task. This way pin will be freed during object's destruction.
Something along these lines;
There is obviously an issue when sb creates multiple instances of
Pinobjects referencing the same hardware pin.