Issue #24000: Improved Argument Clinic's mapping of converters to legacy · pythoncapi/cpython@38337d1 · GitHub
Skip to content

Commit 38337d1

Browse files
committed
Issue python#24000: Improved Argument Clinic's mapping of converters to legacy
"format units". Updated the documentation to match.
1 parent 95283fb commit 38337d1

7 files changed

Lines changed: 119 additions & 98 deletions

File tree

Doc/howto/clinic.rst

Lines changed: 33 additions & 37 deletions

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ Documentation
8282
Tools/Demos
8383
-----------
8484

85+
- Issue #24000: Improved Argument Clinic's mapping of converters to legacy
86+
"format units". Updated the documentation to match.
87+
8588
- Issue #24001: Argument Clinic converters now use accept={type}
8689
instead of types={'type'} to specify the types the converter accepts.
8790

Modules/_dbmmodule.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static PySequenceMethods dbm_as_sequence = {
274274
/*[clinic input]
275275
_dbm.dbm.get
276276
277-
key: str(accept={str, robuffer}, length=True)
277+
key: str(accept={str, robuffer}, zeroes=True)
278278
default: object(c_default="NULL") = b''
279279
/
280280
@@ -284,7 +284,8 @@ Return the value for key if present, otherwise default.
284284
static PyObject *
285285
_dbm_dbm_get_impl(dbmobject *self, const char *key,
286286
Py_ssize_clean_t key_length, PyObject *default_value)
287-
/*[clinic end generated code: output=b44f95eba8203d93 input=3c7c1afd9c508457]*/
287+
/*[clinic end generated code: output=b44f95eba8203d93 input=a3a279957f85eb6d]*/
288+
/*[clinic end generated code: output=4f5c0e523eaf1251 input=9402c0af8582dc69]*/
288289
{
289290
datum dbm_key, val;
290291

@@ -301,7 +302,7 @@ _dbm_dbm_get_impl(dbmobject *self, const char *key,
301302

302303
/*[clinic input]
303304
_dbm.dbm.setdefault
304-
key: str(accept={str, robuffer}, length=True)
305+
key: str(accept={str, robuffer}, zeroes=True)
305306
default: object(c_default="NULL") = b''
306307
/
307308
@@ -314,7 +315,7 @@ static PyObject *
314315
_dbm_dbm_setdefault_impl(dbmobject *self, const char *key,
315316
Py_ssize_clean_t key_length,
316317
PyObject *default_value)
317-
/*[clinic end generated code: output=52545886cf272161 input=a66fcb7f18ee2f50]*/
318+
/*[clinic end generated code: output=52545886cf272161 input=bf40c48edaca01d6]*/
318319
{
319320
datum dbm_key, val;
320321
Py_ssize_t tmp_size;

Modules/_gdbmmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ _gdbm_gdbm_firstkey_impl(dbmobject *self)
383383
/*[clinic input]
384384
_gdbm.gdbm.nextkey
385385
386-
key: str(accept={str, robuffer}, length=True)
386+
key: str(accept={str, robuffer}, zeroes=True)
387387
/
388388
389389
Returns the key that follows key in the traversal.
@@ -400,7 +400,7 @@ to create a list in memory that contains them all:
400400
static PyObject *
401401
_gdbm_gdbm_nextkey_impl(dbmobject *self, const char *key,
402402
Py_ssize_clean_t key_length)
403-
/*[clinic end generated code: output=192ab892de6eb2f6 input=1eb2ff9b4b0e6ffd]*/
403+
/*[clinic end generated code: output=192ab892de6eb2f6 input=1f1606943614e36f]*/
404404
{
405405
PyObject *v;
406406
datum dbm_key, nextkey;

Modules/arraymodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,7 +1673,7 @@ array_array_tostring_impl(arrayobject *self)
16731673
/*[clinic input]
16741674
array.array.fromunicode
16751675
1676-
ustr: Py_UNICODE(length=True)
1676+
ustr: Py_UNICODE(zeroes=True)
16771677
/
16781678
16791679
Extends this array with data from the unicode string ustr.
@@ -1686,7 +1686,7 @@ some other type.
16861686
static PyObject *
16871687
array_array_fromunicode_impl(arrayobject *self, Py_UNICODE *ustr,
16881688
Py_ssize_clean_t ustr_length)
1689-
/*[clinic end generated code: output=ebb72fc16975e06d input=56bcedb5ef70139f]*/
1689+
/*[clinic end generated code: output=ebb72fc16975e06d input=150f00566ffbca6e]*/
16901690
{
16911691
char typecode;
16921692

Modules/unicodedata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ unicodedata_UCD_name_impl(PyObject *self, int chr, PyObject *default_value)
12151215
unicodedata.UCD.lookup
12161216
12171217
self: self
1218-
name: str(accept={str, robuffer}, length=True)
1218+
name: str(accept={str, robuffer}, zeroes=True)
12191219
/
12201220
12211221
Look up character by name.
@@ -1227,7 +1227,7 @@ corresponding character. If not found, KeyError is raised.
12271227
static PyObject *
12281228
unicodedata_UCD_lookup_impl(PyObject *self, const char *name,
12291229
Py_ssize_clean_t name_length)
1230-
/*[clinic end generated code: output=765cb8186788e6be input=2dfe682c2491447a]*/
1230+
/*[clinic end generated code: output=765cb8186788e6be input=a557be0f8607a0d6]*/
12311231
{
12321232
Py_UCS4 code;
12331233
unsigned int index;

Tools/clinic/clinic.py

Lines changed: 72 additions & 51 deletions

0 commit comments

Comments
 (0)