Serhiy Storchaka <[email protected]> added the comment:
It is hard to find a builtin which could be easy and clearly implemented in
Python (it means no use of dunder methods). Maybe sorted()?
def sorted(iterable, /, *, key=None, reverse=False):
"""Emulate the built in sorted() function"""
result = list(iterable)
result.sort(key=key, reverse=reverse)
return result
Although I think that this use case is less important. The primary goal of the
feature is mentioned at the end of the section -- easy way to implement
functions which accept arbitrary keyword arguments.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue38237>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com