mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Argument Clinic: rename "self" to "module" for module-level functions.
This commit is contained in:
parent
fd32fffa5a
commit
ed4a1c5703
10 changed files with 88 additions and 79 deletions
|
@ -109,7 +109,8 @@ static Py_UCS4 getuchar(PyUnicodeObject *obj)
|
|||
|
||||
/*[clinic]
|
||||
module unicodedata
|
||||
unicodedata.decimal
|
||||
class unicodedata.UCD
|
||||
unicodedata.UCD.decimal
|
||||
|
||||
unichr: object(type='str')
|
||||
default: object=NULL
|
||||
|
@ -122,23 +123,23 @@ as integer. If no such value is defined, default is returned, or, if
|
|||
not given, ValueError is raised.
|
||||
[clinic]*/
|
||||
|
||||
PyDoc_STRVAR(unicodedata_decimal__doc__,
|
||||
PyDoc_STRVAR(unicodedata_UCD_decimal__doc__,
|
||||
"Converts a Unicode character into its equivalent decimal value.\n"
|
||||
"\n"
|
||||
"unicodedata.decimal(unichr, default=None)\n"
|
||||
"unicodedata.UCD.decimal(unichr, default=None)\n"
|
||||
"\n"
|
||||
"Returns the decimal value assigned to the Unicode character unichr\n"
|
||||
"as integer. If no such value is defined, default is returned, or, if\n"
|
||||
"not given, ValueError is raised.");
|
||||
|
||||
#define UNICODEDATA_DECIMAL_METHODDEF \
|
||||
{"decimal", (PyCFunction)unicodedata_decimal, METH_VARARGS, unicodedata_decimal__doc__},
|
||||
#define UNICODEDATA_UCD_DECIMAL_METHODDEF \
|
||||
{"decimal", (PyCFunction)unicodedata_UCD_decimal, METH_VARARGS, unicodedata_UCD_decimal__doc__},
|
||||
|
||||
static PyObject *
|
||||
unicodedata_decimal_impl(PyObject *self, PyObject *unichr, PyObject *default_value);
|
||||
unicodedata_UCD_decimal_impl(PyObject *self, PyObject *unichr, PyObject *default_value);
|
||||
|
||||
static PyObject *
|
||||
unicodedata_decimal(PyObject *self, PyObject *args)
|
||||
unicodedata_UCD_decimal(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *unichr;
|
||||
|
@ -148,15 +149,15 @@ unicodedata_decimal(PyObject *self, PyObject *args)
|
|||
"O!|O:decimal",
|
||||
&PyUnicode_Type, &unichr, &default_value))
|
||||
goto exit;
|
||||
return_value = unicodedata_decimal_impl(self, unichr, default_value);
|
||||
return_value = unicodedata_UCD_decimal_impl(self, unichr, default_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
unicodedata_decimal_impl(PyObject *self, PyObject *unichr, PyObject *default_value)
|
||||
/*[clinic checksum: 76c8d1c3dbee495d4cfd86ca6829543a3129344a]*/
|
||||
unicodedata_UCD_decimal_impl(PyObject *self, PyObject *unichr, PyObject *default_value)
|
||||
/*[clinic checksum: a0980c387387287e2ac230c37d95b26f6903e0d2]*/
|
||||
{
|
||||
PyUnicodeObject *v = (PyUnicodeObject *)unichr;
|
||||
int have_old = 0;
|
||||
|
@ -1288,7 +1289,7 @@ unicodedata_lookup(PyObject* self, PyObject* args)
|
|||
/* XXX Add doc strings. */
|
||||
|
||||
static PyMethodDef unicodedata_functions[] = {
|
||||
UNICODEDATA_DECIMAL_METHODDEF
|
||||
UNICODEDATA_UCD_DECIMAL_METHODDEF
|
||||
{"digit", unicodedata_digit, METH_VARARGS, unicodedata_digit__doc__},
|
||||
{"numeric", unicodedata_numeric, METH_VARARGS, unicodedata_numeric__doc__},
|
||||
{"category", unicodedata_category, METH_VARARGS,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue