Commit Graph

16 Commits

Author SHA1 Message Date
Donghee Na 7eeea13403
gh-112205: Support @getter annotation from AC (gh-112396) 2023-11-30 19:40:53 +09:00
Donghee Na e52cc80f7f
gh-112213: Add @critical_section target directive to Argument Clinic (gh-112232)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-19 08:05:49 +09:00
Sam Gross 324531df90
gh-111903: Add `@critical_section` directive to Argument Clinic. (#111904)
The `@critical_section` directive instructs Argument Clinic to generate calls
to `Py_BEGIN_CRITICAL_SECTION()` and `Py_END_CRITICAL_SECTION()` around the
bound function. In `--disable-gil` builds, these calls will lock and unlock
the `self` object. They are no-ops in the default build.

This is used in one place (`_io._Buffered.close`) as a demonstration.
Subsequent PRs will use it more widely in the `_io.Buffered` bindings.
2023-11-14 10:47:46 +00:00
Victor Stinner 4e5a7284ee
gh-108444: Argument Clinic uses PyLong_AsInt() (#108458)
Argument Clinic now uses the new public PyLong_AsInt(), rather than
the old name _PyLong_AsInt().
2023-08-25 00:51:22 +02:00
Erlend E. Aasland 39ef93edb9
gh-95065: Argument Clinic: Add functional tests of deprecated positionals (#107768)
Move the "deprecated positinal" tests from clinic.test.c to
_testclinic.c. Mock PY_VERSION_HEX in order to prevent generated
compiler warnings/errors to trigger. Put clinic code for deprecated
positionals in Modules/clinic/_testclinic_depr_star.c.h for easy
inspection of the generated code.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-10 07:19:05 +00:00
Erlend E. Aasland 0a7f48b9a8
gh-95065: Produce nicer deprecation messages in Argument Clinic (#107808) 2023-08-09 13:28:18 +00:00
Erlend E. Aasland 5df8b0d5c7
gh-95065: Argument Clinic: Add comment to preprocessor warning code (#107766) 2023-08-08 08:43:41 +00:00
Erlend E. Aasland 0db043dd5a
gh-95065: Make Argument Clinic append deprecation warnings to docstrings (#107745) 2023-08-08 08:41:09 +02:00
Erlend E. Aasland 835e388915
gh-95065: Argument Clinic: Pretty-print long C strings in generated code (#107712)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-07 14:33:52 +00:00
Erlend E. Aasland 33cb0b06ef
gh-95065: Add Argument Clinic support for deprecating positional use of parameters (#95151)
It is now possible to deprecate passing parameters positionally with
Argument Clinic, using the new '* [from X.Y]' syntax.
(To be read as "keyword-only from Python version X.Y")

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-07 11:28:08 +00:00
Erlend E. Aasland a73daf54eb
gh-106368: Increase Argument Clinic test coverage (#107582)
Add tests for DSL parser state machine and docstring formatting
2023-08-03 09:35:26 +00:00
Erlend E. Aasland b9c9a36c2f
gh-106368: Increase test coverage for Argument Clinic (#107514)
As per this commit, we've got approx. ~91% test coverage for clinic.py.
2023-08-02 13:33:10 +00:00
Erlend E. Aasland 3372bcba98
gh-106970: Fix Argument Clinic 'destination <name> clear' command (#106972)
Add test for the 'destination <name> clear' command,
and the 'destination' directive in general.

Fix two bugs in 'destination <name> clear' command:

1. The text attribute of the allocator is called 'text', not '_text'
2. Return after processing the 'clear' command,
   instead of proceeding directly to the fail().
2023-07-22 09:43:13 +02:00
Erlend E. Aasland 22379c60ab
gh-106368: Increase Argument Clinic test coverage for cpp.Monitor (#106833) 2023-07-17 20:55:10 +00:00
Erlend E. Aasland ec45c513d3
gh-106368: Increase Argument Clinic test coverage (#106728)
- improve output_parameter() coverage
- improve coverage for Function.kind
2023-07-13 22:18:32 +00:00
Erlend E. Aasland a941bd6c53
gh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test.c (#106443) 2023-07-05 08:33:05 +00:00