Skip to content
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

Merged
merged 5 commits into from
Jul 28, 2022

Conversation

sobolevn
Copy link
Member

Refs #12237
Should be merged after #13264 since checkexpr is using unicode as well.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

# 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
Copy link
Member

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:
Copy link
Member

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).

@sobolevn
Copy link
Member Author

Thanks, great points! Removed.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@hauntsaninja hauntsaninja merged commit f84e2cf into python:master Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants