Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

I believe each of these has been discussed and individually rejected before.  
They don't apply as neatly to Python as one would hope.  Identity is usually 
inefficient in Python and we use a func=None as a substitute.  Identity also 
had issues with returning scalars versus an args tuple and issues with keyword 
arguments.   Compose wasn't found to be generally useful in typical Python 
programming and its application order was deemed to be confusing relative to a 
simple nested function call or a simple lambda.  Compose also had challenges 
with chaining multi-argument functions together in an intuitive way.  For both, 
there were also error message issues and other challenges to making code that 
is easily debuggable when there is a failure.  We did accept partial() because 
it was a good fit with the language, it was easy to reason about, and it had a 
number of known use cases in real code.   FWIW, it is not the aspiration of the 
functools module to emulate a straight functional programmin
 g environment.  It is more a generic set of tools that that have function-like 
behavior rather than class-like behavior.   Please also take a look a various 
posts from Guido van Rossum on why didn't push the language more in the 
direction of functional programming.

Thank for the suggestion, but this isn't the first time it has crossed our 
minds.  If there had been a good case for these constructs, it would have 
happened long ago :-)

----------
nosy: +rhettinger
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

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

Reply via email to