Conversation
In particular:
- The test case mentioned in the code passes without it
- The test case changed seems to have more desirable behaviour now,
consider:
```
from typing import Any
"""
class C:
def __radd__(self, other) -> float:
return 1.234
"""
C: Any
class D(C):
pass
reveal_type("str" + D())
```
JukkaL
approved these changes
Feb 25, 2020
Collaborator
JukkaL
left a comment
There was a problem hiding this comment.
Thanks! I agree that it looks like has_member can now be safely removed.
@Michael0x2a In case you think that the comment is still valid and this isn't something we should do, we can reconsider this change.
Collaborator
|
If all the tests are now passing/the metaclass thing no longer seems to be an issue, I agree merging this seems like a good idea. I do remember filing an issue related to this in #5491 -- it could be worth double-checking to see if we also still need to keep that open. |
sthagen
added a commit
to sthagen/python-mypy
that referenced
this pull request
Feb 25, 2020
mypy: remove has_member (python#8438)
msullivan
added a commit
that referenced
this pull request
Mar 6, 2020
It turns out that the has_member check is an important (accidental?) performance optimization. Removing this caused a major (30+%?) slowdown at dropbox. There might be a better way to optimize this but I'm just going to revert it for now at least. This reverts commit 09cdab4.
ilevkivskyi
pushed a commit
that referenced
this pull request
Mar 6, 2020
It turns out that the has_member check is an important (accidental?) performance optimization. Removing this caused a major (30+%?) slowdown at dropbox. There might be a better way to optimize this but I'm just going to revert it for now at least. This reverts commit 09cdab4.
msullivan
added a commit
that referenced
this pull request
Mar 6, 2020
It turns out that the has_member check is an important (accidental?) performance optimization. Removing this caused a major (30+%?) slowdown at dropbox. There might be a better way to optimize this but I'm just going to revert it for now at least. This reverts commit 09cdab4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In particular:
consider: