-
Notifications
You must be signed in to change notification settings - Fork 258
Add typing.Text? #204
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
Comments
I don't think any of the proposals on the table includes Text being EDIT in Python 2 |
Interesting. In that case, I believe typeshed should start using |
I can believe that. (But why not AnyStr?)
|
|
OK, go ahead and make the changes you think are necessary, or send them to me as PRs. This should be pretty uncontroversial. |
typing.Text now exists everywhere. |
See python/mypy#1141 and https://groups.google.com/forum/#!topic/python-ideas/gA1gdj3RZ5g
Having
typing.Text
as an alias for (on Python 2)Union[str, unicode]
and for (on Python 3)Union[bytes, str]
would simplify some stubs in typeshed. (And allow typeshed stubs to be shared between Python 2 and 3)However, there are concerns that people would use typing.Text in
*.py
, not just*.pyi
, thus weakening the type-checking static analysis tools can do. (And the distinction between unicode and str in Python 2 programs is critical when porting to Python 3)The text was updated successfully, but these errors were encountered: