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
The functionally equivalent alternative way shows all lines as precise:
# All lines are marked precisefromtypingimportTypedDictUserDict=TypedDict('UserDict', {'user_id': int, 'email': str})
user:UserDict= { 'user_id': 1, 'email': 'you@somewhere.com' }
Expected Behavior
The member definitions in a TypedDict class should be marked precise.
Actual Behavior
Only 5 / 7 lines of code are considered precise with the user_id: int and email: str lines being marked imprecise. In the HTML report those lines have the title Any Types on this line: Error (x1).
Your Environment
Python 3.10.3
mypy 0.942
Clean venv, run with `mypy --html-report report --txt-report . .``
Ubuntu 20.04.4
The text was updated successfully, but these errors were encountered:
Bug Report
When defining a
TypedDict
class as in the example below, the lines defining the members of the dict are considered to be imprecise by the reports.To Reproduce
The functionally equivalent alternative way shows all lines as precise:
Expected Behavior
The member definitions in a
TypedDict
class should be marked precise.Actual Behavior
Only 5 / 7 lines of code are considered precise with the
user_id: int
andemail: str
lines being marked imprecise. In the HTML report those lines have the titleAny Types on this line: Error (x1)
.Your Environment
The text was updated successfully, but these errors were encountered: