Skip to content

IntEnum with NewType value type regression #10411

Closed
@JukkaL

Description

@JukkaL

The type of E.A.value in this program has changed since the last release:

from typing import NewType
from enum import IntEnum

N = NewType("N", int)

class E(IntEnum):
    A = N(0)

# mypy 0.812: N
# master:     int
reveal_type(E.A.value)

The original inferred type N is more precise, so this looks like a regression. This causes false positives with mypy-protobuf.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions