mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 23:31:05 +07:00
Not doing it not only led to incorrect results, but also could cause serious
performance problems as in PY-59727 when we started recursively analyzing
assignments to a parent dict, producing gigantic hierarchies of nested
TypedDict types as a result.
Namely, each type we tried to infer a TypedDict for a dict literal
in the RHS of an assignment to another dict's key, like the following
d['key'] = {...}
we started to analyze all the modifications of "d" all over again, even though
they couldn't affect the type of the assigned literal. Doing that, we eventually
tried to infer the type of this literal again, and the recursion guard in
TypeEvalContext finally set off. But before that, we'd already constructed
a tree of TypedDicts with the depth roughly equal to the number of such
subscripted assignments to "d". For the user's example, such a TypedDict
contained millions of elements completely hanging our inspections.
GitOrigin-RevId: 5a17894d501086ed4d4ec6bdd8a17c1f05dd7bd5