Skip to content

fix: pass class to classmethod magic methods - #6283

Open
ImFeH2 wants to merge 2 commits into
PyO3:mainfrom
ImFeH2:fix-classmethod-magic-methods
Open

fix: pass class to classmethod magic methods#6283
ImFeH2 wants to merge 2 commits into
PyO3:mainfrom
ImFeH2:fix-classmethod-magic-methods

Conversation

@ImFeH2

@ImFeH2 ImFeH2 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #6088.

Convert slot receivers to their runtime type before passing them to #[classmethod] magic methods, while preserving receiver validation for binary operators.

Tests cover __len__, __call__, and __add__.

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

Successfully merging this pull request may close these issues.

#[classmethod] on magic methods incorrectly passes the object instance

1 participant