Skip to content

Conversation

@Strilanc
Copy link
Collaborator

@Strilanc Strilanc commented Jan 13, 2026

Authored by rafaelha in #1010 then tweaked due to 3.6 and 3.7 support being dropped

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.

@Strilanc Strilanc enabled auto-merge (squash) January 13, 2026 21:00
@Strilanc Strilanc merged commit 73c3d6c into main Jan 13, 2026
61 checks passed
@Strilanc Strilanc deleted the literals branch January 13, 2026 21:33
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.

2 participants