-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Refactoring: Remove the "erased" attribute of Instance #12499
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
Conversation
It's not used for anything.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -847,7 +847,7 @@ def analyze_enum_class_attribute_access(itype: Instance, | |||
# in typeshed. However, this is really more of an implementation detail of how Enums | |||
# are typed, and we really don't want to treat every single Enum value as if it were | |||
# from type variable substitution. So we reset the 'erased' field here. | |||
return itype.copy_modified(erased=False, last_known_value=enum_literal) |
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.
Docstring should be modified too
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.
Removed the comment.
mypy/expandtype.py
Outdated
@@ -94,8 +94,7 @@ def visit_type_var(self, t: TypeVarType) -> Type: | |||
if isinstance(repl, Instance): | |||
inst = repl | |||
# Return copy of instance with type erasure flag on. |
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.
# Return copy of instance with type erasure flag on. | |
# Return copy of instance. |
mypy/expandtype.py
Outdated
@@ -104,8 +103,7 @@ def visit_param_spec(self, t: ParamSpecType) -> Type: | |||
if isinstance(repl, Instance): | |||
inst = repl | |||
# Return copy of instance with type erasure flag on. |
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.
# Return copy of instance with type erasure flag on. | |
# Return copy of instance. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
It's not used for anything.