Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys.implementation is a namedtuple, not a tuple #708

Open
scy opened this issue Dec 11, 2022 · 1 comment
Open

sys.implementation is a namedtuple, not a tuple #708

scy opened this issue Dec 11, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request Quality QA of published stubs

Comments

@scy
Copy link

scy commented Dec 11, 2022

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".

@Josverl
Copy link
Owner

Josverl commented Dec 15, 2022

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

@Josverl Josverl added the enhancement New feature or request label Dec 16, 2022
@Josverl Josverl self-assigned this Dec 16, 2022
@Josverl Josverl added the Quality QA of published stubs label Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Quality QA of published stubs
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants