Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
sobolevn wants to merge4 commits intopython:main
base:main
Choose a base branch
Loading
fromsobolevn:issue-111500

Conversation

sobolevn
Copy link
Member

@sobolevnsobolevn commentedOct 31, 2023
edited by bedevere-appbot
Loading

Hnasar and bluetech reacted with heart emoji
@sobolevn
Copy link
MemberAuthor

@ericvsmith friendly ping :)

@JelleZijlstraJelleZijlstra changed the titlegh-111500: Fixsuper() without args calls fordataclasses with slotsgh-90562: Fixsuper() without args calls fordataclasses with slotsMar 12, 2024
Copy link
Member

@serhiy-storchakaserhiy-storchaka left a 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)

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?

Comment on lines +1238 to +1239
if isinstance(item, (classmethod, staticmethod)):
closure_cells = getattr(item.__func__, "__closure__", None)

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.

carljm reacted with thumbs up emoji
@serhiy-storchaka
Copy link
Member

and method with some common decorator.

For examplepartialmethod,singledispatchmethod andrecursive_repr.

Oh,singledispatchmethod should be handled explicitly because, likeproperty, it refers to multiple methods and closures should be fixed in all of them.

Thenpartial andsingledispatch should probably also be supported, for static methods.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@carljmcarljmcarljm left review comments

@JelleZijlstraJelleZijlstraJelleZijlstra left review comments

@serhiy-storchakaserhiy-storchakaserhiy-storchaka left review comments

@AlexWaygoodAlexWaygoodAlexWaygood left review comments

@ericvsmithericvsmithAwaiting requested review from ericvsmithericvsmith is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@sobolevn@serhiy-storchaka@carljm@JelleZijlstra@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp