hello,
I would like just to note that pylint compains with the library with this error message:
Module 'RPi.GPIO' has no 'LOW' member
Python 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import RPi >>> dir(RPi) ['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__'] >>> dir(RPi.GPIO) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'RPi' has no attribute 'GPIO' >>> import RPi.GPIO >>> dir(RPi.GPIO) ['BCM', 'BOARD', 'BOTH', 'FALLING', 'HARD_PWM', 'HIGH', 'I2C', 'IN', 'LOW', 'OUT', 'PUD_DOWN', 'PUD_OFF', 'PUD_UP', 'PWM', 'RISING', 'RPI_INFO', 'RPI_REVISION', 'SERIAL', 'SPI', 'UNKNOWN', 'VERSION', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'add_event_callback', 'add_event_detect', 'cleanup', 'event_detected', 'getmode', 'gpio_function', 'input', 'output', 'remove_event_detect', 'setmode', 'setup', 'setwarnings', 'wait_for_edge']
A funny behaviour
Adding type stubs would help teach linting and type-checking tools about possible imports, symbols and class/methods definitions.
See https://peps.python.org/pep-0561/#specification
If the maintainer(s) of this project does not want to provide and maintain type-stubs, you can create your own package and distribute it on PyPI. Or request and/or add it to https://github.com/python/typeshed .
This also relates to the following stub-request Pylance issue: https://github.com/microsoft/python-type-stubs/issues/207
RPi.GPIO stubs are on typeshed as of https://github.com/python/typeshed/pull/11345