Steven D'Aprano added the comment:

I had a work mate make this exact same point literally yesterday. He asked me 
if Python had an identity function, and when I suggested just using `lambda x: 
x` he grouched that this wasn't sufficiently obvious enough as "identity" is 
self-explanatory.

(Perhaps for English speakers with a background in mathematics or functional 
programming.)

I'm not really convinced. Its easier to just write a lambda than to `from 
functools import identity`, and despite what my workmate thinks, "identity" is 
not self-evident. Consider that identity could also be a function that returns 
a person's identifying information. Think about the English usage of "identity 
theft" and "secret identity", rather than the mathematical meaning.

So I'm at best +0 on this suggestion.

----------
nosy: +steven.daprano

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue27858>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to