Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-90562: Fixsuper()
without args calls fordataclasses
with slots#111538
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@ericvsmith friendly ping :) |
super()
without args calls fordataclasses
with slotssuper()
without args calls fordataclasses
with slotsUh 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.
Please add tests for classmethod, staticmethod, property (with and without getter, setter and deleter), cached_property, normal method and method with some common decorator.
if isinstance(item, (classmethod, staticmethod)): | ||
closure_cells = getattr(item.__func__, "__closure__", None) | ||
elif isinstance(item, property): | ||
closure_cells = getattr(item.fget, "__closure__", None) |
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.
What if a getter doesn't have a closure, but a setter or deleter does?
if isinstance(item, (classmethod, staticmethod)): | ||
closure_cells = getattr(item.__func__, "__closure__", None) |
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.
classmethod
andstaticmethod
have the__wrapped__
attribute since 3.10, so this code is perhaps dead.
For example Oh, Then |
Uh oh!
There was an error while loading.Please reload this page.
Thanks a lot to@hynek for the attrs project :)
Credit goes tohttps://github.com/python-attrs/attrs/blob/52c1cd97d723cde6d75259a22d218f9305ecf8ee/src/attr/_make.py#L884-L912