Is there a built-in function in Python 3 for the function lambda x: x
? Sometimes it may make some code more elegant. For example:
def my_sort(lst, key):
...
lst = [4, 3, 7, 1, 9]
my_sort(lst, key=lambda x: x) # probably it can be written in a better way WITHOUT lambda x: x with the help of a standard function
I need a build-in or standard function in Python 3, not an expression like lambda x: x
of a different way to improve my code.