Skip to content

Removes a lot of unused code #11698

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

Merged
merged 4 commits into from
Jan 1, 2022
Merged

Removes a lot of unused code #11698

merged 4 commits into from
Jan 1, 2022

Conversation

sobolevn
Copy link
Member

After working on #11696 I was interested in knowing how many more unused code we have.

I am not suggesting that we should remove everything I found, all items must be carefully reviewed. Because they might be used by other people. But, I am sure we can totally remove some of the code I found.

@sobolevn
Copy link
Member Author

TODO: is_subtype_ignoring_tvars

return typ.fallback
else:
return None

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it used in some important place? Or is it popular in plugin code? 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally speaking, this func helped me understand the effects of fallback and related code structure in mypy when I was a new contributor

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@97littleleaf11 we can try to solve this via docs. Probably I can copy paste this function into some docstring. Thanks a lot for the idea! 👍

@@ -903,6 +903,31 @@ class Instance(ProperType):
"""An instance type of form C[T1, ..., Tn].

The list of type variables may be empty.

Several types has fallbacks to `Instance`. Why?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hauntsaninja hauntsaninja merged commit 1beed9a into python:master Jan 1, 2022
@hauntsaninja
Copy link
Collaborator

This is great. Looks like some of the useful looking functions in there dated back to the old semantic analyser.

tushar-deepsource pushed a commit to DeepSourceCorp/mypy that referenced this pull request Jan 20, 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