Skip to content

tests/cpydiff/core_class: Document issue with super in classmethod. #15509

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

Closed

Conversation

AJMansfield
Copy link
Contributor

@AJMansfield AJMansfield commented Jul 20, 2024

Summary

This documents an existing problem with the way super() is implemented that became evident while I was implementing __init_subclass__, where when used inside a classmethod it defers to the ancestor of the class object itself (i.e. type), rather than parent classes it inherits from.

This is probably an issue with super itself not treating the second argument differently when its a type in the way that CPython does.

Testing

I've verified this against CPython versions 3.8, 3.10, and 3.12.

Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
Copy link

codecov bot commented Jul 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.42%. Comparing base (a734ee9) to head (ebbdde6).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15509   +/-   ##
=======================================
  Coverage   98.42%   98.42%           
=======================================
  Files         161      161           
  Lines       21252    21252           
=======================================
  Hits        20918    20918           
  Misses        334      334           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dpgeorge
Copy link
Member

Thanks for the test case / report.

I was curious about why the difference existed, and upon investigating managed to fix it. See #15533.

@AJMansfield AJMansfield deleted the super-classmethod branch July 24, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Relates to tests/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy