Skip to content

"Invalid type" error for Optional[int] alias #3191

Closed
@pgjones

Description

@pgjones

The following snippet fails with 5: error: Invalid type "T" with mypy 0.501 on Python 3.5.2.

from typing import List, Optional

T = Optional[int]

Ts = []  # type: List[T]

This is similar to #1637 and was originally discussed there.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions