[Python-checkins] cpython (3.5): Specify default values of semantic booleans in Argument Clinic generated

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


https://hg.python.org/cpython/rev/f0487d3db275
changeset:   96371:f0487d3db275
branch:      3.5
parent:      96369:f089b060688d
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sat May 30 11:30:39 2015 +0300
summary:
  Specify default values of semantic booleans in Argument Clinic generated signatures as booleans.

files:
  Modules/cjkcodecs/clinic/multibytecodec.c.h |   6 ++--
  Modules/cjkcodecs/multibytecodec.c          |   8 +++---
  Modules/clinic/pyexpat.c.h                  |  12 +++++-----
  Modules/pyexpat.c                           |   8 +++---
  Objects/bytearrayobject.c                   |   4 +-
  Objects/bytesobject.c                       |   4 +-
  Python/bltinmodule.c                        |   8 +++---
  Python/clinic/bltinmodule.c.h               |  10 ++++----
  8 files changed, 30 insertions(+), 30 deletions(-)


diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h
--- a/Modules/cjkcodecs/clinic/multibytecodec.c.h
+++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h
@@ -79,7 +79,7 @@
 }
 
 PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_encode__doc__,
-"encode($self, /, input, final=0)\n"
+"encode($self, /, input, final=False)\n"
 "--\n"
 "\n");
 
@@ -126,7 +126,7 @@
 }
 
 PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_decode__doc__,
-"decode($self, /, input, final=0)\n"
+"decode($self, /, input, final=False)\n"
 "--\n"
 "\n");
 
@@ -317,4 +317,4 @@
 
 #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF    \
     {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
-/*[clinic end generated code: output=c104f5fd548c1ac5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=eebb21e18c3043d1 input=a9049054013a1b77]*/
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -884,14 +884,14 @@
 _multibytecodec.MultibyteIncrementalEncoder.encode
 
     input: object
-    final: int = 0
+    final: int(c_default="0") = False
 [clinic start generated code]*/
 
 static PyObject *
 _multibytecodec_MultibyteIncrementalEncoder_encode_impl(MultibyteIncrementalEncoderObject *self,
                                                         PyObject *input,
                                                         int final)
-/*[clinic end generated code: output=123361b6c505e2c1 input=456b76d73e464661]*/
+/*[clinic end generated code: output=123361b6c505e2c1 input=a345c688fa664f92]*/
 {
     return encoder_encode_stateful(STATEFUL_ECTX(self), input, final);
 }
@@ -1041,14 +1041,14 @@
 _multibytecodec.MultibyteIncrementalDecoder.decode
 
     input: Py_buffer
-    final: int = 0
+    final: int(c_default="0") = False
 [clinic start generated code]*/
 
 static PyObject *
 _multibytecodec_MultibyteIncrementalDecoder_decode_impl(MultibyteIncrementalDecoderObject *self,
                                                         Py_buffer *input,
                                                         int final)
-/*[clinic end generated code: output=b9b9090e8a9ce2ba input=eb18c2f6e83589e1]*/
+/*[clinic end generated code: output=b9b9090e8a9ce2ba input=576631c61906d39d]*/
 {
     MultibyteDecodeBuffer buf;
     char *data, *wdata = NULL;
diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h
--- a/Modules/clinic/pyexpat.c.h
+++ b/Modules/clinic/pyexpat.c.h
@@ -3,7 +3,7 @@
 [clinic start generated code]*/
 
 PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__,
-"Parse($self, data, isFinal=0, /)\n"
+"Parse($self, data, isfinal=False, /)\n"
 "--\n"
 "\n"
 "Parse XML data.\n"
@@ -15,19 +15,19 @@
 
 static PyObject *
 pyexpat_xmlparser_Parse_impl(xmlparseobject *self, PyObject *data,
-                             int isFinal);
+                             int isfinal);
 
 static PyObject *
 pyexpat_xmlparser_Parse(xmlparseobject *self, PyObject *args)
 {
     PyObject *return_value = NULL;
     PyObject *data;
-    int isFinal = 0;
+    int isfinal = 0;
 
     if (!PyArg_ParseTuple(args, "O|i:Parse",
-        &data, &isFinal))
+        &data, &isfinal))
         goto exit;
-    return_value = pyexpat_xmlparser_Parse_impl(self, data, isFinal);
+    return_value = pyexpat_xmlparser_Parse_impl(self, data, isfinal);
 
 exit:
     return return_value;
@@ -281,4 +281,4 @@
 #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
     #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
 #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */
-/*[clinic end generated code: output=958c0faa1b855fc7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=bf4d99c9702d8a6c input=a9049054013a1b77]*/
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -707,7 +707,7 @@
 pyexpat.xmlparser.Parse
 
     data: object
-    isFinal: int = 0
+    isfinal: int(c_default="0") = False
     /
 
 Parse XML data.
@@ -717,8 +717,8 @@
 
 static PyObject *
 pyexpat_xmlparser_Parse_impl(xmlparseobject *self, PyObject *data,
-                             int isFinal)
-/*[clinic end generated code: output=37e105d55645b0f2 input=e37b81b8948ca7e0]*/
+                             int isfinal)
+/*[clinic end generated code: output=f4db843dd1f4ed4b input=199d9e8e92ebbb4b]*/
 {
     const char *s;
     Py_ssize_t slen;
@@ -748,7 +748,7 @@
         slen -= MAX_CHUNK_SIZE;
     }
     assert(MAX_CHUNK_SIZE < INT_MAX && slen < INT_MAX);
-    rc = XML_Parse(self->itself, s, (int)slen, isFinal);
+    rc = XML_Parse(self->itself, s, (int)slen, isfinal);
 
 done:
     if (view.buf != NULL)
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -2773,7 +2773,7 @@
 /*[clinic input]
 bytearray.splitlines
 
-    keepends: int(py_default="False") = 0
+    keepends: int(c_default="0") = False
 
 Return a list of the lines in the bytearray, breaking at line boundaries.
 
@@ -2783,7 +2783,7 @@
 
 static PyObject *
 bytearray_splitlines_impl(PyByteArrayObject *self, int keepends)
-/*[clinic end generated code: output=4223c94b895f6ad9 input=36f0b25bc792f6c0]*/
+/*[clinic end generated code: output=4223c94b895f6ad9 input=8ccade941e5ea0bd]*/
 {
     return stringlib_splitlines(
         (PyObject*) self, PyByteArray_AS_STRING(self),
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -2942,7 +2942,7 @@
 /*[clinic input]
 bytes.splitlines
 
-    keepends: int(py_default="False") = 0
+    keepends: int(c_default="0") = False
 
 Return a list of the lines in the bytes, breaking at line boundaries.
 
@@ -2952,7 +2952,7 @@
 
 static PyObject *
 bytes_splitlines_impl(PyBytesObject*self, int keepends)
-/*[clinic end generated code: output=995c3598f7833cad input=ddb93e3351080c8c]*/
+/*[clinic end generated code: output=995c3598f7833cad input=7f4aac67144f9944]*/
 {
     return stringlib_splitlines(
         (PyObject*) self, PyBytes_AS_STRING(self),
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -637,7 +637,7 @@
     filename: object(converter="PyUnicode_FSDecoder")
     mode: str
     flags: int = 0
-    dont_inherit: int = 0
+    dont_inherit: int(c_default="0") = False
     optimize: int = -1
 
 Compile source into a code object that can be executed by exec() or eval().
@@ -648,9 +648,9 @@
 single (interactive) statement, or 'eval' to compile an expression.
 The flags argument, if present, controls which future statements influence
 the compilation of the code.
-The dont_inherit argument, if non-zero, stops the compilation inheriting
+The dont_inherit argument, if true, stops the compilation inheriting
 the effects of any future statements in effect in the code calling
-compile; if absent or zero these statements do influence the compilation,
+compile; if absent or false these statements do influence the compilation,
 in addition to any features explicitly specified.
 [clinic start generated code]*/
 
@@ -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=7faa105f669fefcf]*/
+/*[clinic end generated code: output=31881762c1bb90c4 input=9d53e8cfb3c86414]*/
 {
     Py_buffer view = {NULL, NULL};
     const char *str;
diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h
--- a/Python/clinic/bltinmodule.c.h
+++ b/Python/clinic/bltinmodule.c.h
@@ -129,8 +129,8 @@
 }
 
 PyDoc_STRVAR(builtin_compile__doc__,
-"compile($module, /, source, filename, mode, flags=0, dont_inherit=0,\n"
-"        optimize=-1)\n"
+"compile($module, /, source, filename, mode, flags=0,\n"
+"        dont_inherit=False, optimize=-1)\n"
 "--\n"
 "\n"
 "Compile source into a code object that can be executed by exec() or eval().\n"
@@ -141,9 +141,9 @@
 "single (interactive) statement, or \'eval\' to compile an expression.\n"
 "The flags argument, if present, controls which future statements influence\n"
 "the compilation of the code.\n"
-"The dont_inherit argument, if non-zero, stops the compilation inheriting\n"
+"The dont_inherit argument, if true, stops the compilation inheriting\n"
 "the effects of any future statements in effect in the code calling\n"
-"compile; if absent or zero these statements do influence the compilation,\n"
+"compile; if absent or false these statements do influence the compilation,\n"
 "in addition to any features explicitly specified.");
 
 #define BUILTIN_COMPILE_METHODDEF    \
@@ -660,4 +660,4 @@
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=9b34d1ca57effad8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=bec3399c0aee98d7 input=a9049054013a1b77]*/

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


More information about the Python-checkins mailing list