Skip to content
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

Inheriting from TypedDict/NamedTuple is flagged as invalid #3884

Closed
gaborbernat opened this issue Oct 8, 2020 · 3 comments
Closed

Inheriting from TypedDict/NamedTuple is flagged as invalid #3884

gaborbernat opened this issue Oct 8, 2020 · 3 comments

Comments

@gaborbernat
Copy link

gaborbernat commented Oct 8, 2020

See https://bugs.python.org/issue41973, the type of TypedDict/NamedTuple is now function, which apparently is a valid object to inherit from.

@gaborbernat gaborbernat changed the title Inheriting from TypedDict is flagged as invalid Inheriting from TypedDict/NamedTuple is flagged as invalid Oct 8, 2020
@hippo91
Copy link
Contributor

hippo91 commented Oct 10, 2020

@gaborbernat is your problem related to pylint? If so please give us a snippet that illustrates it and follow the template for bug submission.

@gaborbernat
Copy link
Author

gaborbernat commented Oct 11, 2020

from typing import TypedDict, NamedTuple

class CustomDict(TypedDict):
    alpha: int

class CustomTuple(NamedTuple):
    beta: int
pylint 'magic.py'
************* Module magic
magic.py:3:0: E0239: Inheriting 'TypedDict', which is not a class. (inherit-non-class)
magic.py:6:0: E0239: Inheriting 'NamedTuple', which is not a class. (inherit-non-class)

@hippo91
Copy link
Contributor

hippo91 commented Oct 11, 2020

@gaborbernat this issue it the same as #3876. I close this issue.

@hippo91 hippo91 closed this as completed Oct 11, 2020
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

No branches or pull requests

2 participants