[Python-checkins] cpython (3.5): Use converter names instead of format units in Argument Clinic descriptions

serhiy.storchaka python-checkins at python.org
Sat May 30 10:33:37 CEST 2015


https://hg.python.org/cpython/rev/f089b060688d
changeset:   96369:f089b060688d
branch:      3.5
parent:      96367:fe4efc0032b5
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sat May 30 11:09:35 2015 +0300
summary:
  Use converter names instead of format units in Argument Clinic descriptions
in builtin and _crypt modules.

files:
  Modules/_cryptmodule.c |    6 +-
  Python/bltinmodule.c   |  144 ++++++++++++++--------------
  2 files changed, 75 insertions(+), 75 deletions(-)


diff --git a/Modules/_cryptmodule.c b/Modules/_cryptmodule.c
--- a/Modules/_cryptmodule.c
+++ b/Modules/_cryptmodule.c
@@ -17,8 +17,8 @@
 /*[clinic input]
 crypt.crypt
 
-    word: 's'
-    salt: 's'
+    word: str
+    salt: str
     /
 
 Hash a *word* with the given *salt* and return the hashed password.
@@ -32,7 +32,7 @@
 
 static PyObject *
 crypt_crypt_impl(PyModuleDef *module, const char *word, const char *salt)
-/*[clinic end generated code: output=995ad1e854d83069 input=4d93b6d0f41fbf58]*/
+/*[clinic end generated code: output=995ad1e854d83069 input=0e8edec9c364352b]*/
 {
     /* On some platforms (AtheOS) crypt returns NULL for an invalid
        salt. Return None in that case. XXX Maybe raise an exception?  */
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -235,7 +235,7 @@
 /*[clinic input]
 abs as builtin_abs
 
-    x: 'O'
+    x: object
     /
 
 Return the absolute value of the argument.
@@ -243,7 +243,7 @@
 
 static PyObject *
 builtin_abs(PyModuleDef *module, PyObject *x)
-/*[clinic end generated code: output=6833047c493ecea2 input=aa29cc07869b4732]*/
+/*[clinic end generated code: output=6833047c493ecea2 input=bed4ca14e29c20d1]*/
 {
     return PyNumber_Absolute(x);
 }
@@ -251,7 +251,7 @@
 /*[clinic input]
 all as builtin_all
 
-    iterable: 'O'
+    iterable: object
     /
 
 Return True if bool(x) is True for all values x in the iterable.
@@ -261,7 +261,7 @@
 
 static PyObject *
 builtin_all(PyModuleDef *module, PyObject *iterable)
-/*[clinic end generated code: output=089e6d1b7bde27b1 input=dd506dc9998d42bd]*/
+/*[clinic end generated code: output=089e6d1b7bde27b1 input=1a7c5d1bc3438a21]*/
 {
     PyObject *it, *item;
     PyObject *(*iternext)(PyObject *);
@@ -300,7 +300,7 @@
 /*[clinic input]
 any as builtin_any
 
-    iterable: 'O'
+    iterable: object
     /
 
 Return True if bool(x) is True for any x in the iterable.
@@ -310,7 +310,7 @@
 
 static PyObject *
 builtin_any(PyModuleDef *module, PyObject *iterable)
-/*[clinic end generated code: output=1be994b2c2307492 input=8fe8460f3fbbced8]*/
+/*[clinic end generated code: output=1be994b2c2307492 input=41d7451c23384f24]*/
 {
     PyObject *it, *item;
     PyObject *(*iternext)(PyObject *);
@@ -349,7 +349,7 @@
 /*[clinic input]
 ascii as builtin_ascii
 
-    obj: 'O'
+    obj: object
     /
 
 Return an ASCII-only representation of an object.
@@ -362,7 +362,7 @@
 
 static PyObject *
 builtin_ascii(PyModuleDef *module, PyObject *obj)
-/*[clinic end generated code: output=d4e862c48af2a933 input=0cbdc1420a306325]*/
+/*[clinic end generated code: output=d4e862c48af2a933 input=4c62732e1b3a3cc9]*/
 {
     return PyObject_ASCII(obj);
 }
@@ -371,7 +371,7 @@
 /*[clinic input]
 bin as builtin_bin
 
-    number: 'O'
+    number: object
     /
 
 Return the binary representation of an integer.
@@ -382,7 +382,7 @@
 
 static PyObject *
 builtin_bin(PyModuleDef *module, PyObject *number)
-/*[clinic end generated code: output=25ee26c6cf3bbb54 input=2a6362ae9a9c9203]*/
+/*[clinic end generated code: output=25ee26c6cf3bbb54 input=53f8a0264bacaf90]*/
 {
     return PyNumber_ToBase(number, 2);
 }
@@ -391,7 +391,7 @@
 /*[clinic input]
 callable as builtin_callable
 
-    obj: 'O'
+    obj: object
     /
 
 Return whether the object is callable (i.e., some kind of function).
@@ -402,7 +402,7 @@
 
 static PyObject *
 builtin_callable(PyModuleDef *module, PyObject *obj)
-/*[clinic end generated code: output=f4df2ce92364b656 input=bb3bb528fffdade4]*/
+/*[clinic end generated code: output=f4df2ce92364b656 input=1423bab99cc41f58]*/
 {
     return PyBool_FromLong((long)PyCallable_Check(obj));
 }
@@ -564,7 +564,7 @@
 /*[clinic input]
 format as builtin_format
 
-    value: 'O'
+    value: object
     format_spec: unicode(c_default="NULL") = ''
     /
 
@@ -576,7 +576,7 @@
 static PyObject *
 builtin_format_impl(PyModuleDef *module, PyObject *value,
                     PyObject *format_spec)
-/*[clinic end generated code: output=4341fd78a5f01764 input=e23f2f11e0098c64]*/
+/*[clinic end generated code: output=4341fd78a5f01764 input=6325e751a1b29b86]*/
 {
     return PyObject_Format(value, format_spec);
 }
@@ -584,7 +584,7 @@
 /*[clinic input]
 chr as builtin_chr
 
-    i: 'i'
+    i: int
     /
 
 Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff.
@@ -592,7 +592,7 @@
 
 static PyObject *
 builtin_chr_impl(PyModuleDef *module, int i)
-/*[clinic end generated code: output=67fe4d87e690f373 input=9b1ced29615adf66]*/
+/*[clinic end generated code: output=67fe4d87e690f373 input=3f604ef45a70750d]*/
 {
     return PyUnicode_FromOrdinal(i);
 }
@@ -633,12 +633,12 @@
 /*[clinic input]
 compile as builtin_compile
 
-    source: 'O'
+    source: object
     filename: object(converter="PyUnicode_FSDecoder")
-    mode: 's'
-    flags: 'i' = 0
-    dont_inherit: 'i' = 0
-    optimize: 'i' = -1
+    mode: str
+    flags: int = 0
+    dont_inherit: int = 0
+    optimize: int = -1
 
 Compile source into a code object that can be executed by exec() or eval().
 
@@ -658,7 +658,7 @@
 builtin_compile_impl(PyModuleDef *module, PyObject *source,
                      PyObject *filename, const char *mode, int flags,
                      int dont_inherit, int optimize)
-/*[clinic end generated code: output=31881762c1bb90c4 input=c6212a9d21472f7e]*/
+/*[clinic end generated code: output=31881762c1bb90c4 input=7faa105f669fefcf]*/
 {
     Py_buffer view = {NULL, NULL};
     const char *str;
@@ -775,8 +775,8 @@
 /*[clinic input]
 divmod as builtin_divmod
 
-    x: 'O'
-    y: 'O'
+    x: object
+    y: object
     /
 
 Return the tuple ((x-x%y)/y, x%y).  Invariant: div*y + mod == x.
@@ -784,7 +784,7 @@
 
 static PyObject *
 builtin_divmod_impl(PyModuleDef *module, PyObject *x, PyObject *y)
-/*[clinic end generated code: output=9ad0076120ebf9ac input=c9c617b7bb74c615]*/
+/*[clinic end generated code: output=9ad0076120ebf9ac input=7fdb15f8a97a5fe7]*/
 {
     return PyNumber_Divmod(x, y);
 }
@@ -793,9 +793,9 @@
 /*[clinic input]
 eval as builtin_eval
 
-    source: 'O'
-    globals: 'O' = None
-    locals: 'O' = None
+    source: object
+    globals: object = None
+    locals: object = None
     /
 
 Evaluate the given source in the context of globals and locals.
@@ -810,7 +810,7 @@
 static PyObject *
 builtin_eval_impl(PyModuleDef *module, PyObject *source, PyObject *globals,
                   PyObject *locals)
-/*[clinic end generated code: output=7284501fb7b4d666 input=31e42c1d2125b50b]*/
+/*[clinic end generated code: output=7284501fb7b4d666 input=11ee718a8640e527]*/
 {
     PyObject *result, *tmp = NULL;
     Py_buffer view = {NULL, NULL};
@@ -878,9 +878,9 @@
 /*[clinic input]
 exec as builtin_exec
 
-    source: 'O'
-    globals: 'O' = None
-    locals: 'O' = None
+    source: object
+    globals: object = None
+    locals: object = None
     /
 
 Execute the given source in the context of globals and locals.
@@ -895,7 +895,7 @@
 static PyObject *
 builtin_exec_impl(PyModuleDef *module, PyObject *source, PyObject *globals,
                   PyObject *locals)
-/*[clinic end generated code: output=83d574ef9d5d0b46 input=536e057b5e00d89e]*/
+/*[clinic end generated code: output=83d574ef9d5d0b46 input=01ca3e1c01692829]*/
 {
     PyObject *v;
 
@@ -1022,8 +1022,8 @@
 /*[clinic input]
 hasattr as builtin_hasattr
 
-    obj: 'O'
-    name: 'O'
+    obj: object
+    name: object
     /
 
 Return whether the object has an attribute with the given name.
@@ -1033,7 +1033,7 @@
 
 static PyObject *
 builtin_hasattr_impl(PyModuleDef *module, PyObject *obj, PyObject *name)
-/*[clinic end generated code: output=81154fdd63634696 input=b50bad5f739ea10d]*/
+/*[clinic end generated code: output=81154fdd63634696 input=0faec9787d979542]*/
 {
     PyObject *v;
 
@@ -1063,7 +1063,7 @@
 id as builtin_id
 
     self: self(type="PyModuleDef *")
-    obj as v: 'O'
+    obj as v: object
     /
 
 Return the identity of an object.
@@ -1074,7 +1074,7 @@
 
 static PyObject *
 builtin_id(PyModuleDef *self, PyObject *v)
-/*[clinic end generated code: output=0aa640785f697f65 input=a1f988d98357341d]*/
+/*[clinic end generated code: output=0aa640785f697f65 input=5a534136419631f4]*/
 {
     return PyLong_FromVoidPtr(v);
 }
@@ -1297,9 +1297,9 @@
 /*[clinic input]
 setattr as builtin_setattr
 
-    obj: 'O'
-    name: 'O'
-    value: 'O'
+    obj: object
+    name: object
+    value: object
     /
 
 Sets the named attribute on the given object to the specified value.
@@ -1310,7 +1310,7 @@
 static PyObject *
 builtin_setattr_impl(PyModuleDef *module, PyObject *obj, PyObject *name,
                      PyObject *value)
-/*[clinic end generated code: output=d881c655c0f7e34f input=fbe7e53403116b93]*/
+/*[clinic end generated code: output=d881c655c0f7e34f input=bd2b7ca6875a1899]*/
 {
     if (PyObject_SetAttr(obj, name, value) != 0)
         return NULL;
@@ -1322,8 +1322,8 @@
 /*[clinic input]
 delattr as builtin_delattr
 
-    obj: 'O'
-    name: 'O'
+    obj: object
+    name: object
     /
 
 Deletes the named attribute from the given object.
@@ -1333,7 +1333,7 @@
 
 static PyObject *
 builtin_delattr_impl(PyModuleDef *module, PyObject *obj, PyObject *name)
-/*[clinic end generated code: output=ef653e698a0b4187 input=647af2ce9183a823]*/
+/*[clinic end generated code: output=ef653e698a0b4187 input=db16685d6b4b9410]*/
 {
     if (PyObject_SetAttr(obj, name, (PyObject *)NULL) != 0)
         return NULL;
@@ -1345,7 +1345,7 @@
 /*[clinic input]
 hash as builtin_hash
 
-    obj: 'O'
+    obj: object
     /
 
 Return the hash value for the given object.
@@ -1356,7 +1356,7 @@
 
 static PyObject *
 builtin_hash(PyModuleDef *module, PyObject *obj)
-/*[clinic end generated code: output=1f32ff154c1f751a input=ccc4d2b9a351df4e]*/
+/*[clinic end generated code: output=1f32ff154c1f751a input=58c48be822bf9c54]*/
 {
     Py_hash_t x;
 
@@ -1370,7 +1370,7 @@
 /*[clinic input]
 hex as builtin_hex
 
-    number: 'O'
+    number: object
     /
 
 Return the hexadecimal representation of an integer.
@@ -1381,7 +1381,7 @@
 
 static PyObject *
 builtin_hex(PyModuleDef *module, PyObject *number)
-/*[clinic end generated code: output=618489ce3cbc5858 input=e816200b0a728ebe]*/
+/*[clinic end generated code: output=618489ce3cbc5858 input=e645aff5fc7d540e]*/
 {
     return PyNumber_ToBase(number, 16);
 }
@@ -1417,7 +1417,7 @@
 /*[clinic input]
 len as builtin_len
 
-    obj: 'O'
+    obj: object
     /
 
 Return the number of items in a container.
@@ -1425,7 +1425,7 @@
 
 static PyObject *
 builtin_len(PyModuleDef *module, PyObject *obj)
-/*[clinic end generated code: output=8e5837b6f81d915b input=2e5ff15db9a2de22]*/
+/*[clinic end generated code: output=8e5837b6f81d915b input=bc55598da9e9c9b5]*/
 {
     Py_ssize_t res;
 
@@ -1596,7 +1596,7 @@
 /*[clinic input]
 oct as builtin_oct
 
-    number: 'O'
+    number: object
     /
 
 Return the octal representation of an integer.
@@ -1607,7 +1607,7 @@
 
 static PyObject *
 builtin_oct(PyModuleDef *module, PyObject *number)
-/*[clinic end generated code: output=18f701bc6d8f804a input=a3a372b521b3dd13]*/
+/*[clinic end generated code: output=18f701bc6d8f804a input=ad6b274af4016c72]*/
 {
     return PyNumber_ToBase(number, 8);
 }
@@ -1616,7 +1616,7 @@
 /*[clinic input]
 ord as builtin_ord
 
-    c: 'O'
+    c: object
     /
 
 Return the Unicode code point for a one-character string.
@@ -1624,7 +1624,7 @@
 
 static PyObject *
 builtin_ord(PyModuleDef *module, PyObject *c)
-/*[clinic end generated code: output=04fd27272d9462f6 input=762355f87451efa3]*/
+/*[clinic end generated code: output=04fd27272d9462f6 input=3064e5d6203ad012]*/
 {
     long ord;
     Py_ssize_t size;
@@ -1671,9 +1671,9 @@
 /*[clinic input]
 pow as builtin_pow
 
-    x: 'O'
-    y: 'O'
-    z: 'O' = None
+    x: object
+    y: object
+    z: object = None
     /
 
 Equivalent to x**y (with two arguments) or x**y % z (with three arguments)
@@ -1684,7 +1684,7 @@
 
 static PyObject *
 builtin_pow_impl(PyModuleDef *module, PyObject *x, PyObject *y, PyObject *z)
-/*[clinic end generated code: output=1fba268adba9b45f input=561a942d5f5c1899]*/
+/*[clinic end generated code: output=1fba268adba9b45f input=653d57d38d41fc07]*/
 {
     return PyNumber_Power(x, y, z);
 }
@@ -1978,7 +1978,7 @@
 /*[clinic input]
 repr as builtin_repr
 
-    obj: 'O'
+    obj: object
     /
 
 Return the canonical string representation of the object.
@@ -1988,7 +1988,7 @@
 
 static PyObject *
 builtin_repr(PyModuleDef *module, PyObject *obj)
-/*[clinic end generated code: output=dc41784fa4341834 input=a2bca0f38a5a924d]*/
+/*[clinic end generated code: output=dc41784fa4341834 input=1c9e6d66d3e3be04]*/
 {
     return PyObject_Repr(obj);
 }
@@ -2045,9 +2045,9 @@
 /* [disabled clinic input]
 sorted as builtin_sorted
 
-    iterable as seq: 'O'
-    key as keyfunc: 'O' = None
-    reverse: 'O' = False
+    iterable as seq: object
+    key as keyfunc: object = None
+    reverse: object = False
 
 Return a new list containing all items from the iterable in ascending order.
 
@@ -2145,7 +2145,7 @@
 /*[clinic input]
 sum as builtin_sum
 
-    iterable: 'O'
+    iterable: object
     start: object(c_default="NULL") = 0
     /
 
@@ -2158,7 +2158,7 @@
 
 static PyObject *
 builtin_sum_impl(PyModuleDef *module, PyObject *iterable, PyObject *start)
-/*[clinic end generated code: output=33655b248b21d581 input=90ae7a242cfcf025]*/
+/*[clinic end generated code: output=33655b248b21d581 input=3b5b7a9d7611c73a]*/
 {
     PyObject *result = start;
     PyObject *temp, *item, *iter;
@@ -2322,8 +2322,8 @@
 /*[clinic input]
 isinstance as builtin_isinstance
 
-    obj: 'O'
-    class_or_tuple: 'O'
+    obj: object
+    class_or_tuple: object
     /
 
 Return whether an object is an instance of a class or of a subclass thereof.
@@ -2336,7 +2336,7 @@
 static PyObject *
 builtin_isinstance_impl(PyModuleDef *module, PyObject *obj,
                         PyObject *class_or_tuple)
-/*[clinic end generated code: output=f960b7c12dbbeda0 input=cf9eb0ad6bb9bad6]*/
+/*[clinic end generated code: output=f960b7c12dbbeda0 input=ffa743db1daf7549]*/
 {
     int retval;
 
@@ -2350,8 +2350,8 @@
 /*[clinic input]
 issubclass as builtin_issubclass
 
-    cls: 'O'
-    class_or_tuple: 'O'
+    cls: object
+    class_or_tuple: object
     /
 
 Return whether 'cls' is a derived from another class or is the same class.
@@ -2364,7 +2364,7 @@
 static PyObject *
 builtin_issubclass_impl(PyModuleDef *module, PyObject *cls,
                         PyObject *class_or_tuple)
-/*[clinic end generated code: output=8b012a151940bbf2 input=923d03fa41fc352a]*/
+/*[clinic end generated code: output=8b012a151940bbf2 input=af5f35e9ceaddaf6]*/
 {
     int retval;
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list