-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Improve readline
typings
#7141
Improve readline
typings
#7141
Conversation
This comment has been minimized.
This comment has been minimized.
Type aliases still use old-style |
stdlib/readline.pyi
Outdated
_CompleterT = Optional[Callable[[str, int], Optional[str]]] | ||
_CompDispT = Optional[Callable[[str, Sequence[str], int], None]] | ||
_CompleterT = Callable[[str, int], str | None] | ||
_CompDispT = Callable[[str, Sequence[str], int], None] |
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.
Nit: These shouldn't be named ending with T
, because they aren't type variables.
python/mypy#11098 is the relevant mypy issue if you wanna help us get to a place where we can use PEP 604 syntax everywhere in typeshed ;) I tried looking at it today for a little while, but understanding the mypy codebase is still a little like wading through treacle for me :( |
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
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.
Thanks!
Thanks for the review! I am trying to fix mypy to allow I hope it can make its way into |
Changes:
Optional
, is this a bug?set_startup_hook
can take any callable, the return type is ignored