| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -3016,10 +3016,6 @@ def __new__(cls, typename, bases, ns): | |
| if "__classcell__" in ns: | ||
| raise TypeError( | ||
| "uses of super() and __class__ are unsupported in methods of NamedTuple subclasses") | ||
| for base in bases: | ||
| if base is not _NamedTuple and base is not Generic: | ||
| raise TypeError( | ||
| 'can only inherit from a NamedTuple type and Generic') | ||
|
Comment thread
Comment on lines
-3019
to
-3022
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityPlease consider addressing https://gist.github.com/johnslavik/4d0e22df6cb61868f74269fe7d401f5b.
Sorry, something went wrong.
serhiy-storchaka reacted with thumbs up emoji
All reactions
|
||
| bases = tuple(tuple if base is _NamedTuple else base for base in bases) | ||
| if "__annotations__" in ns: | ||
| types = ns["__annotations__"] | ||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add support for arbitrary multiple inheritance with :class:`typing.NamedTuple`. |
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityMaybe add a test to check the order of the members as well when doing unpacking? And maybe test class Z(X, Y, NamedTuple)? (I don't know if this leads to a MRO incompatibilty though)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIt will be error. This is tested in the next test.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.