mirror of
https://github.com/python/cpython.git
synced 2025-08-25 11:15:02 +00:00
bpo-37206: Unrepresentable default values no longer represented as None. (GH-13933)
In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values (like in the optional third parameter of getattr). "None" should be used if None is accepted as argument and passing None has the same effect as not passing the argument at all.
This commit is contained in:
parent
d057b896f9
commit
279f44678c
47 changed files with 256 additions and 257 deletions
|
@ -12522,7 +12522,7 @@ do_strip(PyObject *self, int striptype)
|
|||
static PyObject *
|
||||
do_argstrip(PyObject *self, int striptype, PyObject *sep)
|
||||
{
|
||||
if (sep != NULL && sep != Py_None) {
|
||||
if (sep != Py_None) {
|
||||
if (PyUnicode_Check(sep))
|
||||
return _PyUnicode_XStrip(self, striptype, sep);
|
||||
else {
|
||||
|
@ -12559,7 +12559,7 @@ unicode_strip_impl(PyObject *self, PyObject *chars)
|
|||
/*[clinic input]
|
||||
str.lstrip as unicode_lstrip
|
||||
|
||||
chars: object = NULL
|
||||
chars: object = None
|
||||
/
|
||||
|
||||
Return a copy of the string with leading whitespace removed.
|
||||
|
@ -12569,7 +12569,7 @@ If chars is given and not None, remove characters in chars instead.
|
|||
|
||||
static PyObject *
|
||||
unicode_lstrip_impl(PyObject *self, PyObject *chars)
|
||||
/*[clinic end generated code: output=3b43683251f79ca7 input=9e56f3c45f5ff4c3]*/
|
||||
/*[clinic end generated code: output=3b43683251f79ca7 input=529f9f3834448671]*/
|
||||
{
|
||||
return do_argstrip(self, LEFTSTRIP, chars);
|
||||
}
|
||||
|
@ -12578,7 +12578,7 @@ unicode_lstrip_impl(PyObject *self, PyObject *chars)
|
|||
/*[clinic input]
|
||||
str.rstrip as unicode_rstrip
|
||||
|
||||
chars: object = NULL
|
||||
chars: object = None
|
||||
/
|
||||
|
||||
Return a copy of the string with trailing whitespace removed.
|
||||
|
@ -12588,7 +12588,7 @@ If chars is given and not None, remove characters in chars instead.
|
|||
|
||||
static PyObject *
|
||||
unicode_rstrip_impl(PyObject *self, PyObject *chars)
|
||||
/*[clinic end generated code: output=4a59230017cc3b7a input=ac89d0219cb411ee]*/
|
||||
/*[clinic end generated code: output=4a59230017cc3b7a input=62566c627916557f]*/
|
||||
{
|
||||
return do_argstrip(self, RIGHTSTRIP, chars);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue