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/043822.html below:

[Python-Dev] Re: PEP 318: Decorators last before colon

[Python-Dev] Re: PEP 318: Decorators last before colon [Python-Dev] Re: PEP 318: Decorators last before colonWalter Dörwald walter.doerwald at livinglogic.de
Wed Mar 31 13:58:09 EST 2004
Guido van Rossum wrote:

>>A simple issue I have with:
>>     [classmethod, logged, debug]
>>     def function(args):
>>         ...
>>Is "How do you type this into Idle?"  I realize this is not the most
>>important of considerations, but access to experimentation is going to
>>be vital.  You can always force with:
>> >>> if True:
>>         [classmethod, logged, debug]
>>         def function(args):
>>             ...
>>
>>but I wonder if we want to go that route.
> 
> 
> Since it will normally be part of a class, you shouldn't have any
> problem.  I expect that toplevel functions with decorators will be
> rare enough to put up with the "if True" work-around.

This looks ugly to me. I do have top level functions that would use
decorators because those functions will be put into a class as
classmethods and this class will be put into sys.modules instead of
the original module. Replacing

def foo(cls):
    ...
foo = classmethod(foo)

with

if True:
    [classmethod]
    def foo(cls):
       ...

doesn't look that attractive to me.

Bye,
    Walter Dörwald



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