Skip to content
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

gh-91098: Use Argument Clinic for Object/classobject.c to fix docstrings #31711

Merged
merged 14 commits into from Apr 19, 2022

Conversation

arhadthedev
Copy link
Contributor

@arhadthedev arhadthedev commented Mar 6, 2022

Closes GH-91098.

@arhadthedev arhadthedev changed the title Convert Object/classobject.c to Argument Clinic bpo-46942: Convert Object/classobject.c to Argument Clinic Mar 7, 2022
@arhadthedev arhadthedev marked this pull request as ready for review Mar 7, 2022
@arhadthedev arhadthedev requested a review from terryjreedy as a code owner Mar 7, 2022
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /*(hashfunc)instancemethod_hash, tp_hash */
Copy link
Contributor Author

@arhadthedev arhadthedev Mar 7, 2022

Choose a reason for hiding this comment

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

@vstinner Should instancemethod_hash be kept or removed? It has been commented out since its introduction on 11 Dec 2007 .

Copy link
Member

@vstinner vstinner Mar 12, 2022

Choose a reason for hiding this comment

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

I would prefer to have a separated PR to remove it.

@arhadthedev arhadthedev deleted the ac-classobject branch Mar 21, 2022
@arhadthedev arhadthedev restored the ac-classobject branch Mar 21, 2022
@arhadthedev
Copy link
Contributor Author

arhadthedev commented Mar 21, 2022

Accidentally autoclosed by deleting a wrong remote branch.

@arhadthedev arhadthedev reopened this Mar 21, 2022
@arhadthedev arhadthedev changed the title bpo-46942: Convert Object/classobject.c to Argument Clinic gh-91098: Convert Object/classobject.c to Argument Clinic Apr 10, 2022
@arhadthedev arhadthedev changed the title gh-91098: Convert Object/classobject.c to Argument Clinic gh-91098: Use Argument Clinic for Object/classobject.c to fix docstrings Apr 13, 2022
@arhadthedev arhadthedev reopened this Apr 17, 2022
Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Thanks, happy to see more Argument Clinic in the code!

@@ -0,0 +1,4 @@
:func:`idlelib.calltip.get_argspec` now correctly reports that
Copy link
Member

@JelleZijlstra JelleZijlstra Apr 18, 2022

Choose a reason for hiding this comment

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

This is an odd way to put it. It's not idlelib that changed, but classobject.c. Can we just say something like "Use Argument Clinic for the types.MethodType constructor"?

/*[clinic input]
@classmethod
instancemethod.__new__
function: object
Copy link
Member

@JelleZijlstra JelleZijlstra Apr 18, 2022

Choose a reason for hiding this comment

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

Let's keep this positional-only.

Create a bound instance method object.");
/*[clinic input]
@classmethod
method.__new__
Copy link
Member

@JelleZijlstra JelleZijlstra Apr 18, 2022

Choose a reason for hiding this comment

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

Suggested change
method.__new__
method.__new__ as method_new

A bit weird to have "method" as a function name in C. Same for instancemethod below.

@JelleZijlstra JelleZijlstra self-assigned this Apr 18, 2022
@arhadthedev
Copy link
Contributor Author

arhadthedev commented Apr 18, 2022

@JelleZijlstra Thank you for the review, addressed.

@JelleZijlstra JelleZijlstra merged commit 7fbc7f6 into python:main Apr 19, 2022
13 checks passed
@arhadthedev arhadthedev deleted the ac-classobject branch Apr 19, 2022
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.

Convert Object/classobject.c to Argument Clinic
5 participants