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

Make all type annotations lazy #386

Merged
merged 1 commit into from Nov 20, 2022

Conversation

orsinium
Copy link
Contributor

PEP 563 introduced postponed evaluation of type annotations. It makes importing modules faster and allows to use the latest Python features in older Python releases and to use forward references and type-checking-only objects without quoting annotations. In other words, a lot of cool stuff. The feature can be activated since Python 3.7 by adding in the file from __future__ import annotations. The feature was supposed to be the default behavior since Python 3.10 or so, but was postponed indefinitely because of some corner cases when it doesn't work well (runtime type annotation evaluation for closures).

@orsinium
Copy link
Contributor Author

CI is just being a drama queen again. test_fetch_n needs some love.

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wallyqs wallyqs merged commit 2b31c90 into nats-io:main Nov 20, 2022
@orsinium orsinium deleted the lazy-annotations branch November 20, 2022 08:11
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.

None yet

2 participants