Skip to content

Conversation

@rafaelha
Copy link

Small quality of life improvement: Literal type hints to enable IDE autocomplete.

image

I tried to find all cases where Literal type hints can be provided. In a few places the stubs already had Literal type hints, but without importing from typing import Literal they did not do anything for me. I've gone ahead and added

try:
    from typing import Literal
except ImportError:
    pass

to dev/gen_stim_stub_file.py.

For Python <=3.7 one could also consider importing Literal from typing_extensions, but it's probably better not to introduce an additional dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant