Skip to content

Synthetic types are not processed in third pass #3308

Closed
@ilevkivskyi

Description

@ilevkivskyi

While working on #3305 I discovered that "synthetic" types are not always properly processed in third pass (also there can be additional problems with them in fixup.py). This leads to crashes like these:

from typing import List, NewType, NamedTuple
from mypy_extensions import TypedDict

NT = NewType('NT', List[int, str])

class NM(NamedTuple):
    x: List[int, str]

class TD(TypedDict):
    x: List[int, str]

# crashers: any of these crashes with "IndexError: list index out of range"

TD({'x': []})
NM(x=[])
NT([])

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions