[Python-ideas] Function composition (was no subject)

João Santos jmcs at jsantos.eu
Thu May 7 11:09:59 CEST 2015


On Wed, 6 May 2015 at 16:51 Steven D'Aprano <steve at pearwood.info> wrote:

>
> I think that there are some questions that would need to be answered.
> For instance, given some composition:
>
>     f = math.sin @ (lambda x: x**2)
>
> what would f.__name__ return? What about str(f)?
>

Lambdas return '<lambda>' so maybe something like '<composed>'?
Then str(f) would be '<function <composed> at 0xffffffffffff>'.


> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150507/5cf96286/attachment.html>


More information about the Python-ideas mailing list