I'd like to add to @DaniilFajnberg's answer: while the reason he stated are correct, there is a solution to the problem without actually # type: ignore
ing all such cases (which could be numerous).
All you have to do is explicitly tell pylance type of the dictionary:
external_data: dict[str, typing.Any] = {
'id': 123,
'name': 'Vlad',
'signup_ts': datetime.now(),
'friends': [1, 2, 3],
}
user = User(**external_data)
This will make pylance very happy and the errors will go away :)