Skip to content

bpo-36042 Check for methods, make them classmethod#11943

Closed
isidentical wants to merge 1 commit intopython:masterfrom
isidentical:fix-classgetitem
Closed

bpo-36042 Check for methods, make them classmethod#11943
isidentical wants to merge 1 commit intopython:masterfrom
isidentical:fix-classgetitem

Conversation

@isidentical
Copy link
Copy Markdown
Member

@isidentical isidentical commented Feb 19, 2019

In each setattr operation check if name is init_subclass or
class_getitem and make them classmethod.

https://bugs.python.org/issue36042

@the-knights-who-say-ni
Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

In each setattr operation check if name is __init_subclass__ or
__class_getitem__ and make them classmethod.
Comment thread Objects/typeobject.c
&& PyFunction_Check (value))
{
value = PyClassMethod_New (value);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't put space between function name and (.
And use _PyUnicode_EqualToASCIIString instead of _PyUnicode_EqualToASCIIString.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants