-
Notifications
You must be signed in to change notification settings - Fork 250
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
Built-in generic now work without limitations #1068
Conversation
docs/source/stubs.rst
Outdated
|
||
In these cases, the appropriate types from ``typing`` must be used. | ||
PEP 585 [#pep585]_ built-in generics are supported and should be used instead | ||
of the corresponding types from ``typing``. | ||
|
||
Using imports from ``collections.abc`` instead of ``typing`` is | ||
generally possible and recommended. |
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.
Can we drop the "generally" here too? I don't think there are any exceptions left.
Also, it would be good to have some examples in this section. We can list bad examples like "from typing import Sequence" and "List[int]" and good ones like "from collections.abc import Sequence" and "list[int]".
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.
There are several exceptions that I know of — but it may be that these only apply to typeshed:
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 added a few examples, although I only used positive examples as in other examples in this section.
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.
One nit
Co-authored-by: Jelle Zijlstra <[email protected]>
Closes: #1067