except NameError:
raise ValueError
- if isinstance(value, (str, int, float, bytes, bool, type(None))):
+ if isinstance(value, (str, int, float, bytes, bool, type(None),
+ sentinel)):
return ast.Constant(value)
raise ValueError
self._test_module_has_signatures(faulthandler, unsupported_signature=unsupported_signature)
def test_functools_module_has_signatures(self):
- unsupported_signature = {"reduce"}
- self._test_module_has_signatures(functools, unsupported_signature=unsupported_signature)
+ self._test_module_has_signatures(functools)
def test_gc_module_has_signatures(self):
import gc
function as func: object
iterable as seq: object
/
- initial as result: object = NULL
+ initial as result: object(c_default="NULL") = functools._initial_missing
Apply a function of two arguments cumulatively to the items of an iterable, from left to right.
static PyObject *
_functools_reduce_impl(PyObject *module, PyObject *func, PyObject *seq,
PyObject *result)
-/*[clinic end generated code: output=30d898fe1267c79d input=4ccfb74548ce5170]*/
+/*[clinic end generated code: output=30d898fe1267c79d input=5c9088c98ffe2793]*/
{
PyObject *args, *it;
}
PyDoc_STRVAR(_functools_reduce__doc__,
-"reduce($module, function, iterable, /, initial=<unrepresentable>)\n"
+"reduce($module, function, iterable, /,\n"
+" initial=functools._initial_missing)\n"
"--\n"
"\n"
"Apply a function of two arguments cumulatively to the items of an iterable, from left to right.\n"
return return_value;
}
-/*[clinic end generated code: output=7f2abc718fcc35d5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ac9e26d0a5a23d40 input=a9049054013a1b77]*/