Skip to content

NewType doesn't work with tuples #276

@zsol

Description

@zsol

Describe the Bug

Foo = NewType("Foo", tuple[int, int])

complains that the second argument to NewType is invalid.

(I actually expected type Foo = NewType(...) to work, but that doesn't seem to work in any other type checker either.

Sandbox Link

https://pyrefly.org/sandbox/?code=GYJw9gtgBALgngBwJYDsDmUkQWEMoBUAUEQGJhhQC8UAcgKYDuAKovQBQBE5YnANLACuCADb0A2qhgCpAXQCUJIA

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions