Conversation
hauntsaninja
left a comment
There was a problem hiding this comment.
Hm, the decision not to implement Sized in Collection seems pretty intentional.
Looks like this goes back to #2658 , and was maybe done for Python 2 reasons?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
srittau
left a comment
There was a problem hiding this comment.
Considering that primer does not complain and the change back in 2018 alludes to Python 2/3 problems or problems that may be fixed in mypy 0.650, this looks good to me. But maybe @gvanrossum has some recollection about this?
|
Or @JukkaL :) |
|
This change seems fine, since the original motivation was Python 2/3 compatibility concerns, and the mypy primer output is clean. |
|
I think that it is a good idea to copy original samples to our test cases. |
|
pyright has a different opinion: Ok, a test case won't quite work. But, here's my manual test case for this: |
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
|
Looks like this change breaks mypy: python/mypy#13977 Reproduce with e.g. The two quickest fixes are either: or: Which do people prefer? |
|
I'd prefer removing the metaclass, I don't think we need it there. |
|
I think this change caused a false positive error that I'm seeing. More info in #9296. |
This reverts commit 5bbba5d.
See https://github.com/python/cpython/blob/ad1dc3ebb6aadaeeeacde13d4ed2d62bf302bf62/Lib/_collections_abc.py#L431