KEMBAR78
`Enum` and `NamedTuple` should not allow extra keywords · Issue #16521 · python/mypy · GitHub
Skip to content

Enum and NamedTuple should not allow extra keywords #16521

@sobolevn

Description

@sobolevn

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.

Refs #16432

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions