`Enum` and `NamedTuple` should not allow extra keywords
Open
@sobolevn is already working on this.
Since Nov 18, 2023.
bug
topic-enum
topic-named-tuple
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
This code produces no error:
from typing import NamedTuple
class A(type): ...
class Foo(NamedTuple, metaclass=A, x=1):
x: int
from enum import Enum
class E(Enum, x=1):
a = 1
It is much easier with the NamedTuple, but, I think that enum might allow some keywords like boundary=STRICT.
So, I think that I will split the PRs for these two problems.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.