A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-August/091180.html below:

[Python-Dev] functools.compose to chain functions together

[Python-Dev] functools.compose to chain functions togetherSteven D'Aprano steve at pearwood.info
Sun Aug 16 14:14:56 CEST 2009
On Sat, 15 Aug 2009 04:39:03 am Jason R. Coombs wrote:

> I'd like to express additional interest in python patch 1660179,
> discussed here:
>
> http://mail.python.org/pipermail/patches/2007-February/021687.html
[...]
> But to me, a compose function is much easier to read and much more
> consistent with the decorator usage syntax itself.
>
> def meta_decorator(data):
>     return compose(dec_register_function_for_x, dec_alter_docstring,
>     dec_inject_some_data(data))

Surely that's better written as:

meta_decorator = compose(dec_register_function_for_x,
    dec_alter_docstring, dec_inject_some_data)


> I admit, I may be a bit biased; my first formal programming course
> was taught in Scheme.

Mine wasn't -- I've never even used Scheme, or Lisp, or any other 
functional language. But I've come to appreciate Python's functional 
tools, and would like to give a +0.5 to compose(). +1 if anyone can 
come up with additional use-cases.



-- 
Steven D'Aprano
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4