-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add NamedTupleMeta
metaclass
#11046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NamedTupleMeta
metaclass
#11046
Conversation
Mypy does not like this change:
|
This comment has been minimized.
This comment has been minimized.
I think the reason is that |
This comment has been minimized.
This comment has been minimized.
Now pyright finds some cases where class _ASN1ObjectBase(NamedTuple):
nid: int
shortname: str
longname: str
oid: str
class _ASN1Object(_ASN1ObjectBase):
def __new__(cls, oid: str) -> Self: ...
@classmethod
def fromnid(cls, nid: int) -> Self: ...
@classmethod
def fromname(cls, name: str) -> Self: ...
class Purpose(_ASN1Object, enum.Enum):
SERVER_AUTH: _ASN1Object
CLIENT_AUTH: _ASN1Object Another option for us is to use |
:( |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Sorry, seems like this didn't work out. The linked mypy bug should likely be fixed with special-casing in mypy itself. |
Refs python/mypy#16521
Source: