GeezerVison is showing github.com — Improve the readability and maintainability of test_capi using the AC · Issue #104469 · python/cpython
Improve the readability and maintainability of test_capi using the AC #104469DescriptionCurrently, most of test_capi modules do not use the Argument Clinic tool.
As a result, we manually implement docstrings containing explanations for the test codes and handle parameter parsing manually: PyArg_ParseTuple .
To maintain code consistency in test_capi, I suggest using the Argument Clinic tool.
While some might criticize this as code churn, I believe it is necessary for maintaining consistent test code writing practices. I will attach a sample PR to illustrate how it can help improve the understanding of the test code. I hope this will help clarify the rationale behind it.
cc @erlend-aasland @sobolevn
Linked PRs
Reacted by sunmy2019, Oleg Iarygin, Erlend E. Aasland and 길재은 Reacted by 길재은 Activitychanged the title [-]Improve the readability and maintainability of test_capi using the Argument Clinic tool[/-] [+]Improve the readability and maintainability of test_capi using the AC[/+] on May 14, 2023sunmy2019 commented on May 14, 2023 corona10 commented on May 15, 2023 I am working on test_exceptions. Reacted by Erlend E. Aasland sobolevn commented on May 15, 2023 I am working on _testcapi/watchers.c 👍 Reacted by Erlend E. Aasland erlend-aasland commented on May 15, 2023 Let's establish some guidelines:
- For the sake of readability (which is one of the goals here), please add a newline between the argument spec and the docstring
- If purpose is obvious given a function name, omit the docstring
- If a description is needed, make sure the added docstring clearly and succinctly describes purpose of the function
- DRY, use the clone feature of Argument Clinic
- Try to avoid adding new interned strings; reuse existing parameter names if possible and use the
as feature to override the C name
cc. @sobolevn @corona10 Reacted by sobolevn and Donghee Na sobolevn commented on May 15, 2023 corona10 commented on May 15, 2023
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|