According to the TypedDict documentation, the following code should raise:
error: Unexpected key 'director'
from typing import TypedDict
class Movie(TypedDict):
name: str
year: int
m: Movie = dict(
name='Alien',
year=1979,
director='Ridley Scott')
But nothing happened. I can still query the "director" field. Why is that?
print(m["director"])
Ridley Scott