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
I would expect audience.usernames to be a list[str], because the __init__ overload should create a ListField[str], which should then match to __get__ overload for ListField[str], returning list[str].
Actual Behavior
audience.usernames is unexpectedly typed as list[int].
Your Environment
Mypy version used: 0.812
Mypy command-line flags: none
Mypy configuration options from mypy.ini (and other config files): none
Python version used: 3.7.8
Operating system and version: macOS 11.2.3
The text was updated successfully, but these errors were encountered:
Bug Report
For a generic class with
__init__
overloads and__get__
overloads, mypy is matching overloads unexpectedly.To Reproduce
audience.usernames
andaudience.ages
are bothlist[int]
Here's the example code from the playground:
Expected Behavior
I would expect
audience.usernames
to be alist[str]
, because the__init__
overload should create aListField[str]
, which should then match to__get__
overload forListField[str]
, returninglist[str]
.Actual Behavior
audience.usernames
is unexpectedly typed aslist[int]
.Your Environment
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: