zip.__iter__ and reversed.__iter__ return self#7123
Conversation
(On 3.9)
```
>>> class X(reversed): pass
...
>>> x = X("abc")
>>> type(x)
<class '__main__.X'>
>>> type(iter(x))
<class '__main__.X'>
>>> class Y(zip):
... pass
...
>>> y = Y("abc", "def")
>>> type(y)
<class '__main__.Y'>
>>> type(iter(y))
<class '__main__.Y'>
```
|
Hold on, this isn't true if you're reversing a list (thanks @AlexWaygood): |
This comment has been minimized.
This comment has been minimized.
|
I think we should make the change to |
|
I looked into the C code and realized this PR is right after all. The problem isn't that |
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Huh. Bizarre :) |
(On 3.9)