[issue26729] Incorrect __text_signature__ for sorted
Erik Welch
report at bugs.python.org
Sun Apr 10 13:54:40 EDT 2016
New submission from Erik Welch:
The first argument to sorted is positional-only, so the text signature should be:
sorted($module, iterable, /, key=None, reverse=False)
instead of
sorted($module, iterable, key=None, reverse=False)
To reproduce the issue, attempt to use "iterable" as a keyword argument:
>>> import inspect
>>> sig = inspect.signature(sorted)
>>> sig.bind(iterable=[]) # should raise, but doesn't
>>> sorted(iterable=[]) # raises TypeError
----------
components: Extension Modules, Library (Lib)
files: sorted_1.diff
keywords: patch
messages: 263145
nosy: eriknw
priority: normal
severity: normal
status: open
title: Incorrect __text_signature__ for sorted
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file42422/sorted_1.diff
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26729>
_______________________________________
More information about the Python-bugs-list
mailing list