mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
bpo-23867: Argument Clinic: inline parsing code for a single positional parameter. (GH-9689)
This commit is contained in:
parent
65ce60aef1
commit
32d96a2b5b
49 changed files with 1677 additions and 275 deletions
34
Modules/clinic/_sre.c.h
generated
34
Modules/clinic/_sre.c.h
generated
|
|
@ -47,7 +47,13 @@ _sre_ascii_iscased(PyObject *module, PyObject *arg)
|
|||
int character;
|
||||
int _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "i:ascii_iscased", &character)) {
|
||||
if (PyFloat_Check(arg)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"integer argument expected, got float" );
|
||||
goto exit;
|
||||
}
|
||||
character = _PyLong_AsInt(arg);
|
||||
if (character == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _sre_ascii_iscased_impl(module, character);
|
||||
|
|
@ -78,7 +84,13 @@ _sre_unicode_iscased(PyObject *module, PyObject *arg)
|
|||
int character;
|
||||
int _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "i:unicode_iscased", &character)) {
|
||||
if (PyFloat_Check(arg)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"integer argument expected, got float" );
|
||||
goto exit;
|
||||
}
|
||||
character = _PyLong_AsInt(arg);
|
||||
if (character == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _sre_unicode_iscased_impl(module, character);
|
||||
|
|
@ -109,7 +121,13 @@ _sre_ascii_tolower(PyObject *module, PyObject *arg)
|
|||
int character;
|
||||
int _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "i:ascii_tolower", &character)) {
|
||||
if (PyFloat_Check(arg)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"integer argument expected, got float" );
|
||||
goto exit;
|
||||
}
|
||||
character = _PyLong_AsInt(arg);
|
||||
if (character == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _sre_ascii_tolower_impl(module, character);
|
||||
|
|
@ -140,7 +158,13 @@ _sre_unicode_tolower(PyObject *module, PyObject *arg)
|
|||
int character;
|
||||
int _return_value;
|
||||
|
||||
if (!PyArg_Parse(arg, "i:unicode_tolower", &character)) {
|
||||
if (PyFloat_Check(arg)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"integer argument expected, got float" );
|
||||
goto exit;
|
||||
}
|
||||
character = _PyLong_AsInt(arg);
|
||||
if (character == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
_return_value = _sre_unicode_tolower_impl(module, character);
|
||||
|
|
@ -765,4 +789,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return _sre_SRE_Scanner_search_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=5edeca5ec36b5f34 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=7992634045212b26 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue