Message273644
| Author |
steven.daprano |
| Recipients |
Jáchym Barvínek, steven.daprano |
| Date |
2016年08月25日.11:57:34 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1472126254.83.0.493650882332.issue27858@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年08月25日 11:57:34 | steven.daprano | set | recipients:
+ steven.daprano, Jáchym Barvínek |
| 2016年08月25日 11:57:34 | steven.daprano | set | messageid: <1472126254.83.0.493650882332.issue27858@psf.upfronthosting.co.za> |
| 2016年08月25日 11:57:34 | steven.daprano | link | issue27858 messages |
| 2016年08月25日 11:57:34 | steven.daprano | create |
|