cpython/Tools/clinic/libclinic
Serhiy Storchaka 99e2c5eccd
gh-144545: Improve handling of default values in Argument Clinic (GH-146016)
* Add the c_init_default attribute which is used to initialize the C variable
  if the default is not explicitly provided.
* Add the c_default_init() method which is used to derive c_default from
  default if c_default is not explicitly provided.
* Explicit c_default and py_default are now almost always have precedence
  over the generated value.
* Add support for bytes literals as default values.
* Improve support for str literals as default values (support non-ASCII
  and non-printable characters and special characters like backslash or quotes).
* Fix support for str and bytes literals containing trigraphs, "/*" and "*/".
* Improve support for default values in converters "char" and "int(accept={str})".
* Converter "int(accept={str})" now requires 1-character string instead of
  integer as default value.
* Add support for non-None default values in converter "Py_buffer": NULL,
  str and bytes literals.
* Improve error handling for invalid default values.
* Rename Null to NullType for consistency.
2026-03-17 12:16:35 +02:00
..
__init__.py gh-144545: Improve handling of default values in Argument Clinic (GH-146016) 2026-03-17 12:16:35 +02:00
app.py gh-81313: Add the math.integer module (PEP-791) (GH-133909) 2025-10-31 16:13:43 +02:00
block_parser.py gh-113317, AC: Add libclinic.block_parser module (#116819) 2024-03-14 16:11:39 +00:00
clanguage.py gh-144545: Improve handling of default values in Argument Clinic (GH-146016) 2026-03-17 12:16:35 +02:00
cli.py gh-113317: Finish splitting Argument Clinic into sub-files (#117513) 2024-04-04 11:09:40 +02:00
codegen.py gh-113317: Add ParseArgsCodeGen class (#117707) 2024-04-11 13:49:07 +00:00
converter.py gh-144545: Improve handling of default values in Argument Clinic (GH-146016) 2026-03-17 12:16:35 +02:00
converters.py gh-144545: Improve handling of default values in Argument Clinic (GH-146016) 2026-03-17 12:16:35 +02:00
cpp.py gh-128152: Argument Clinic: ignore pre-processor directives inside C comments (#128464) 2025-01-04 11:46:04 +01:00
dsl_parser.py gh-144545: Improve handling of default values in Argument Clinic (GH-146016) 2026-03-17 12:16:35 +02:00
errors.py gh-113317, AC: Move warn() and fail() to libclinic.errors (#116770) 2024-03-14 08:07:01 +00:00
formatting.py gh-144545: Improve handling of default values in Argument Clinic (GH-146016) 2026-03-17 12:16:35 +02:00
function.py gh-64490: Argument Clinic: Add support for `**kwds` (#138344) 2025-09-18 13:31:42 +00:00
identifiers.py gh-113317: Argument Clinic: move C/Py identifier helpers into libclinic (#115520) 2024-02-16 07:42:15 +01:00
language.py gh-113317: Finish splitting Argument Clinic into sub-files (#117513) 2024-04-04 11:09:40 +02:00
parse_args.py gh-64490: Argument Clinic: Add support for `**kwds` (#138344) 2025-09-18 13:31:42 +00:00
parser.py gh-113317: Finish splitting Argument Clinic into sub-files (#117513) 2024-04-04 11:09:40 +02:00
return_converters.py gh-113317: Add Codegen class to Argument Clinic (#117626) 2024-04-11 12:15:48 +02:00
utils.py gh-144545: Improve handling of default values in Argument Clinic (GH-146016) 2026-03-17 12:16:35 +02:00