You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NiklasRosenstein
changed the title
Bug in return type of deque.copy() if type variables are involved
Bug in return type of deque.copy() if generic type
Apr 21, 2022
NiklasRosenstein
changed the title
Bug in return type of deque.copy() if generic type
Bug in return type of deque.copy() in generic type
Apr 21, 2022
deque.copy in typeshed is just def copy(self: Self) -> Self:, so I do think this is a bug in mypy. Does it reproduce on current master with #12590 applied?
deque.copy in typeshed is just def copy(self: Self) -> Self:, so I do think this is a bug in mypy. Does it reproduce on current master with #12590 applied?
I can reproduce with 0.942, but not with mypy master. The "first good commit" is indeed 20b0b9b -- so yep, #12590 fixed this.
JelleZijlstra
changed the title
Bug in return type of deque.copy() in generic type
[Add test case] Bug in return type of deque.copy() in generic type
Apr 21, 2022
Bug Report
Mypy reasons incorrectly about the return type of
collections.deque.copy()
if the item type is a generic with a type parameter inside a generic class.To Reproduce
Expected Behavior
The return type in the above example should be
List[T]
notList[List[T]]
.Your Environment
Mypy version used: 0.942
Mypy command-line flags:
mypy test.py
Mypy configuration options from
mypy.ini
(and other config files):Python version used: 3.10.2
Operating system and version: OSX 12.2.1 Monterey
The text was updated successfully, but these errors were encountered: