No type hint with return values for TypedDict in PyCharm
Question:
Atm I am starting with the typing
library. When I create a wrong dict in-line I will get a typehint that the created dictionary is indeed not correct, and ‘type hint’: 42 is highlighted.
Is it normal that the wrong return value in the function is not highlighted? Which is ‘no type hint’: 88 in this case.
from typing import TypedDict
class Test(TypedDict):
asdf: str
a1: int
asdf: Test = {'type hint': 42}
def raw_to_prop() -> Test:
return {'no type hint': 88}
Answers:
Atm I am starting with the typing
library. When I create a wrong dict in-line I will get a typehint that the created dictionary is indeed not correct, and ‘type hint’: 42 is highlighted.
Is it normal that the wrong return value in the function is not highlighted? Which is ‘no type hint’: 88 in this case.
from typing import TypedDict
class Test(TypedDict):
asdf: str
a1: int
asdf: Test = {'type hint': 42}
def raw_to_prop() -> Test:
return {'no type hint': 88}