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/2004-March/043088.html below:

[Python-Dev] PEP 318 trial balloon (wrappers)

[Python-Dev] PEP 318 trial balloon (wrappers)Raymond Hettinger python at rcn.com
Thu Mar 11 16:57:09 EST 2004
[Jewett, Jim J]
>     class Foo:
>         def bar():
>             pass
>         bar = transform(bar)
 ...
> I would like to do the same with decorators.
> 
> class Foo:
>     [transform] from:
>         def bar():
>             pass
> 
> The bar() function is now defined exactly as it was before,
> except that it is an extra indent to the right.

-1 This gains nothing over what we have now but does incur costs on
readability, yet another syntax, and limiting the ability to apply a
decoration outside the class definition.

In its favor, this syntax does suggest something new which is the
possibility of having all similar decorations grouped under one banner:

class Foo:
    [transform] from"
        def bar():
            pass
        def bat():
            pass
        def baf():
            pass

That being said, grouping doesn't go much for me.  I think the key to
the previous proposals was putting wrappers on the same line as the
function definition. 



Raymond Hettinger


#################################################################
#################################################################
#################################################################
#####
#####
#####
#################################################################
#################################################################
#################################################################

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