-
Notifications
You must be signed in to change notification settings - Fork 23
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
Ban importing Match
and Pattern
from typing
(import from re
instead)
#324
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
LGTM, one suggestion though.
README.md
Outdated
@@ -55,7 +55,7 @@ currently emitted: | |||
| Y019 | Certain kinds of methods should use `_typeshed.Self` instead of defining custom `TypeVar`s for their return annotation. This check currently applies for instance methods that return `self`, class methods that return an instance of `cls`, and `__new__` methods. | |||
| Y020 | Quoted annotations should never be used in stubs. | |||
| Y021 | Docstrings should not be included in stubs. | |||
| Y022 | Imports linting: use typing-module aliases to stdlib objects as little as possible (e.g. `builtins.list` over `typing.List`, `collections.Counter` over `typing.Counter`, etc.). | |||
| Y022 | Use typing-module aliases to stdlib objects as little as possible (e.g. `builtins.list` over `typing.List`, `collections.OrderedDict` over `typing_extensions.OrderedDict`, etc.). |
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.
Why use typing_extensions
here? I think typing
is more "canonical", easier to understand, and more succinct.
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 realised we didn't mention anywhere that Y022 bans various imports from typing_extensions
as well as various imports from typing
, and that felt like something which might be useful to make clear. But I can reword this if the current phrasing is just confusing!
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.
How's it look now?
This comment has been minimized.
This comment has been minimized.
This change has no effect on typeshed. 🤖🎉 |
Closes #46