Josverl/micropython-stubs

sys.implementation is a namedtuple, not a tuple

Opened this issue · 1 comments

scy commented

The sys stub for 1.19.1 (ESP32) says that sys.implementation is a tuple. However, it’s actually a namedtuple; its items can be accessed as attributes, e.g. sys.implementation.name.

Using sys.implementation.name currently results in error: "Tuple[Any, ...]" has no attribute "name".

I have run into the same, and have a potential fix in the works.
One catch is that the micropython docs state that the value is a tuple, and that some ports supply a named tuple.

For typing a Union of both may be a good enough experience