-
Notifications
You must be signed in to change notification settings - Fork 258
Best Practices: Add note about object/Any #1198
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I'd recommend using from __future__ import annotations
for new syntax without at least having a note mentioning that doing so breaks runtime uses of annotations (and e.g. type aliases won't work).
The note doesn't need to be lengthy or scary, e.g. it could just link to https://mypy.readthedocs.io/en/stable/runtime_troubles.html or something, but I do think we should acknowledge sharp edges.
I'm not sure I follow. What runtime uses break that work without the future import. The mypy docs link doesn't mention anything either. Edit: Or even better yet, propose a wording. |
Co-authored-by: Jelle Zijlstra <[email protected]>
I personally would not recommend using
|
It's not just the edge cases, since we're currently recommending Suggested wording (based on mypy docs):
Of course, if we don't want to recommend future annotations at all because of the edge cases and co_annotations stuff, this is moot. |
I have removed the future import section for now. |
Bumpity bump. |
Part of #851