Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -2200,7 +2200,8 @@ def wrap_value(s):
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

Expand Down
3 changes: 1 addition & 2 deletions Lib/test/test_inspect/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -6255,8 +6255,7 @@ def test_faulthandler_module_has_signatures(self):
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
Expand Down
4 changes: 2 additions & 2 deletions Modules/_functoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ _functools.reduce
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.

Expand All @@ -1081,7 +1081,7 @@ calculates ((((1 + 2) + 3) + 4) + 5).
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;

Expand Down
5 changes: 3 additions & 2 deletions Modules/clinic/_functoolsmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading