-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Remove all builtins.unicode
references
#13272
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
mypy/fastparse.py
Outdated
# If we're analyzing Python 3, that function will translate 'builtins.unicode' | ||
# into 'builtins.str'. In contrast, if we're analyzing Python 2 code, we'll | ||
# translate 'builtins.bytes' in the method below into 'builtins.str'. | ||
|
||
# Do a getattr because the field doesn't exist in 3.8 (where | ||
# this method doesn't actually ever run.) We can't just do | ||
# an attribute access with a `# type: ignore` because it would be | ||
# unused on < 3.8. | ||
kind: str = getattr(n, "kind") # noqa |
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.
This now became unused
@@ -401,12 +401,6 @@ def get_default_arg_types(self, fdef: FuncDef) -> List[Optional[Type]]: | |||
for arg in fdef.arguments | |||
] | |||
|
|||
def add_adjustments(self, typs: List[Type]) -> List[Type]: | |||
if not self.try_text or self.manager.options.python_version[0] != 2: |
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.
It looks like whole --try-text
argument (Try using unicode wherever str is inferred, according to help) is not very useful now. So can probably be deleted (together with tests).
Thanks, great points! Removed. |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Refs #12237
Should be merged after #13264 since
checkexpr
is usingunicode
as well.