[issue27858] Add identity function to functools

2016-08-27 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: rejected -> duplicate stage: -> resolved superseder: -> add identity function ___ Python tracker ___ _

[issue27858] Add identity function to functools

2016-08-25 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> rejected status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing

[issue27858] Add identity function to functools

2016-08-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue1673203, issue11011. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-l

[issue27858] Add identity function to functools

2016-08-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: I believe this has been previously discussed and declined. -- nosy: +rhettinger ___ Python tracker ___ _

[issue27858] Add identity function to functools

2016-08-25 Thread R. David Murray
R. David Murray added the comment: I agree with Steven, I don't think this is really worth it, but I wouldn't vote -1. I suspect it won't get added, though, since a function I do want ('first') got rejected :) -- nosy: +r.david.murray ___ Python tr

[issue27858] Add identity function to functools

2016-08-25 Thread Jáchym Barvínek
Jáchym Barvínek added the comment: Java offers an identity function: https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html 2016-08-25 14:10 GMT+02:00 Steven D'Aprano : > > Steven D'Aprano added the comment: > > Just in case anyone else thinks this is a good idea, here's a p

[issue27858] Add identity function to functools

2016-08-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: Just in case anyone else thinks this is a good idea, here's a patch. -- keywords: +patch Added file: https://bugs.python.org/file44218/identity.patch ___ Python tracker _

[issue27858] Add identity function to functools

2016-08-25 Thread Steven D'Aprano
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. (Perha

[issue27858] Add identity function to functools

2016-08-25 Thread Jáchym Barvínek
New submission from Jáchym Barvínek: An identity function is sometimes useful in functional-style programming as a dummy or default value. For example, we can sometimes see a pattern like this (e.g. in itertools.groupby): def f(params, key=None): if key is None: key = lambda x: x ...