Skip to content

Replace Literal and Protocol with runtime-referable symbols.#651

Merged
junkmd merged 2 commits intoenthought:mainfrom
junkmd:protocols_and_literals
Nov 2, 2024
Merged

Replace Literal and Protocol with runtime-referable symbols.#651
junkmd merged 2 commits intoenthought:mainfrom
junkmd:protocols_and_literals

Conversation

@junkmd
Copy link
Copy Markdown
Collaborator

@junkmd junkmd commented Nov 2, 2024

This is an improvement for static typing.

When supporting versions earlier than Python 3.8, we used tricks combining hints.pyi and type-hinting by string literals to utilize Literal and Protocol.

Since version 1.4.7, support for versions earlier than Python 3.8 has been dropped, so Literal and Protocol can now be used directly from typing.

Dead version bridges in hints.pyi have also been removed.

and add the typing symbol to `shelllink`.
from `hints` to `tools.codegenerator.typeannotator`.
@junkmd junkmd added the typing related to Python static typing system label Nov 2, 2024
@junkmd junkmd added this to the 1.4.9 milestone Nov 2, 2024
junkmd added a commit to junkmd/pywinauto that referenced this pull request Nov 2, 2024
@junkmd junkmd merged commit e62a7e9 into enthought:main Nov 2, 2024
@junkmd junkmd deleted the protocols_and_literals branch November 2, 2024 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

typing related to Python static typing system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant