-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
Advise to use typing.IO sparingly #92877
Comments
PR: #92878 |
How is
I'm curious whether we can come up with a similar list of arguments against using |
All of these things make it quite hard to use custom file-like classes with type checking. Even using file-like objects from libraries becomes hard, because they usually don't implement methods like I believe the best way forward is to create two new protocols |
Documentation
typing.IO
and subclassestyping.TextIO
andtyping.BinaryIO
are a bit of a legacy feature and should be used sparingly. We should document better alternatives. I'm preparing a PR with some suggestions.(Cc @gvanrossum @JelleZijlstra @AlexWaygood)
The text was updated successfully, but these errors were encountered: