[issue26729] Incorrect __text_signature__ for sorted

2017-01-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset c0a9fb3e19b9 by Serhiy Storchaka in branch '3.5': Issue #26729: Fixed __text_signature__ for sorted(). https://hg.python.org/cpython/rev/c0a9fb3e19b9 New changeset fcb19fb42058 by Serhiy Storchaka in branch '3.6': Issue #26729: Fixed

[issue26729] Incorrect __text_signature__ for sorted

2017-01-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue26729] Incorrect __text_signature__ for sorted

2017-01-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: Serhiy, do you want to apply this? -- ___ Python tracker ___ ___

[issue26729] Incorrect __text_signature__ for sorted

2017-01-23 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> serhiy.storchaka ___ Python tracker ___

[issue26729] Incorrect __text_signature__ for sorted

2017-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue29327 and issue29331. sorted_3.patch LGTM. -- stage: patch review -> commit review versions: +Python 3.7 ___ Python tracker

[issue26729] Incorrect __text_signature__ for sorted

2016-04-12 Thread Martin Panter
Martin Panter added the comment: Patch 3 looks okay to me. -- ___ Python tracker ___ ___ Python-bugs-list

[issue26729] Incorrect __text_signature__ for sorted

2016-04-12 Thread Erik Welch
Erik Welch added the comment: sorted_3.patch corrects the __text_signature__. Behavior of sorted is unchanged. >>> def raises(err, lamda): ... try: ... lamda() ... return False ... except err: ... return True ... >>> import inspect >>> sig =

[issue26729] Incorrect __text_signature__ for sorted

2016-04-12 Thread Martin Panter
Martin Panter added the comment: I didn’t realize about the keyword-only parameters. This is inherited from list.sort(). The signature can be corrected in 3.5. There is also Issue 21314 about documenting the slash notation for signatures (it comes from PEP 457). --

[issue26729] Incorrect __text_signature__ for sorted

2016-04-12 Thread Nick Coghlan
Nick Coghlan added the comment: +1 for Serhiy's suggestion of enhancing the C API to specifically handle these cases. -- dependencies: +Add support for partial keyword arguments in extension functions ___ Python tracker

[issue26729] Incorrect __text_signature__ for sorted

2016-04-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue26282. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue26729] Incorrect __text_signature__ for sorted

2016-04-12 Thread Erik Welch
Erik Welch added the comment: That's a fair and valid point, Raymond. "sorted_2.patch" was submitted for consideration. Either __text_signature__ is wrong, or the call argument handling is wrong. One should be fixed. Having a flexible call signature as if sorted were a user-defined

[issue26729] Incorrect __text_signature__ for sorted

2016-04-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't think we should start down the path of changing APIs just to accommodate weakness in the generation of the text signature. We don't want to encourage unreadable oddities like sorted(reverse=False, iterable=source). Best readability comes from the

[issue26729] Incorrect __text_signature__ for sorted

2016-04-11 Thread Erik Welch
Erik Welch added the comment: Interesting observation, Martin. Upon further consideration, the call signature for sorted really is quite odd. It doesn't behave like any other builtin function. Currently, "iterable" is positional-only, and "key=" and "reverse=" are keyword only. I would

[issue26729] Incorrect __text_signature__ for sorted

2016-04-10 Thread Martin Panter
Martin Panter added the comment: This is a strange case. It looks like “iterable” is half-supported as a keyword argument. So Silent Ghost’s patch fixes the signature, but the code still tries to accept keyword arguments: >>> sorted(iterable=None) TypeError: 'NoneType' object is not iterable

[issue26729] Incorrect __text_signature__ for sorted

2016-04-10 Thread SilentGhost
Changes by SilentGhost : -- components: +Interpreter Core -Extension Modules, Library (Lib) nosy: +ncoghlan stage: -> patch review versions: +Python 3.6 ___ Python tracker

[issue26729] Incorrect __text_signature__ for sorted

2016-04-10 Thread Erik Welch
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