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.
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index d4b2c93..070f795 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -12522,7 +12522,7 @@
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 @@
/*[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 @@
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 @@
/*[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 @@
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);
}