This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients rhettinger, tpleyer
Date 2019-01-29.23:49:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1548805748.54.0.345938487142.issue35853@roundup.psfhosted.org>
In-reply-to
Content
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 programming 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 :-)
History
Date User Action Args
2019-01-29 23:49:10rhettingersetrecipients: + rhettinger, tpleyer
2019-01-29 23:49:08rhettingersetmessageid: <1548805748.54.0.345938487142.issue35853@roundup.psfhosted.org>
2019-01-29 23:49:08rhettingerlinkissue35853 messages
2019-01-29 23:49:08rhettingercreate