KEMBAR78
Make enum type compatible with union of all enum item literals by JukkaL · Pull Request #10388 · python/mypy · GitHub
Skip to content

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Apr 30, 2021

For example, consider this enum:

class E(Enum):
    A = 1
    B = 1

This PR makes E compatible with Literal[E.A, E.B].

Also fix mutation of the argument list in
try_contracting_literals_in_union.

This fixes some regressions introduced in #9097.

For example, consider this enum:

```
class E(Enum):
    A = 1
    B = 1
```

This PR makes `E` compatible with `Literal[E.A, E.B]`.

Also fix mutation of the argument list in
`try_contracting_literals_in_union`.

This fixes some regressions introduced in #9097.
@JukkaL JukkaL merged commit 322ef60 into master Apr 30, 2021
@JukkaL JukkaL deleted the enum-subtyping branch April 30, 2021 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants