This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Convert Object/classobject.c to Argument Clinic
Type: enhancement Stage: patch review
Components: Interpreter Core Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: arhadthedev
Priority: normal Keywords: patch

Created on 2022-03-07 08:50 by arhadthedev, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 31711 open arhadthedev, 2022-03-07 08:50
Messages (1)
msg414643 - (view) Author: Oleg Iarygin (arhadthedev) * Date: 2022-03-07 08:50
- Convert method.__reduce__, method.__new__, and instancemethod.__new__ to AC. It looks like nothing else can be converted in classobject.c.

  This is my first time working with AC so I could make some mistakes.

- Fix found mismatches in method.__new__ where docstring and implementation diverged:

  - on how to name arguments (function vs func, instance vs self) - `fuct` is a semi-abbreviation and `self` is a special argument of instance methods. No compatibility is harmed because these arguments were forced to be positional-only anyway with `if (!_PyArg_NoKeywords("method", kw)) return NULL;`.

  - on whether args are positional (the implementation called _PyArg_NoKeywords) or not (the documentation and Lib/idlelib/idle_test/test_calltip.py:80) - align with other assertions in `test_builtins()` that have reference docstrings with both `/` marker and a proper description.

Minor refactoring:

- Since PyMethod_Type and PyInstanceMethod_Type are modified anyway, transform their initialization to C99-style.

- Change a disabler for PyInstanceMethod_Type.tp_hash from comments to `#if 0`.
History
Date User Action Args
2022-04-11 14:59:57adminsetgithub: 91098
2022-03-07 08:50:47arhadthedevsetkeywords: + patch
stage: patch review
pull_requests: + pull_request29834
2022-03-07 08:50:35arhadthedevcreate