-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Removes a lot of unused code #11698
Conversation
TODO: |
return typ.fallback | ||
else: | ||
return None | ||
|
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.
I think we should keep this.
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.
Was it used in some important place? Or is it popular in plugin code? 🤔
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.
Personally speaking, this func helped me understand the effects of fallback
and related code structure in mypy when I was a new contributor
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.
@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? |
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 is great. Looks like some of the useful looking functions in there dated back to the old semantic analyser. |
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.