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

[Python-Dev] Density of pie-decorator syntax

[Python-Dev] Density of pie-decorator syntaxJosh Hoyt josh at janrain.com
Fri Aug 6 18:20:20 CEST 2004
One problem I have with the pie-decorator syntax is that it is very 
typographically dense. The @ character runs in with the following 
function name. If there are multiple lines of decorators, the problem is 
worsened. For clarity, the decorators will have no whitespace lines 
between them, creating a dense block.

After experimenting, I have found that readability is increased if there 
is one space required after the @. Don't take my word for it:

Current Python 2.4a2 syntax:



@framework_stuff(lots, of, args)
class Quux(object):

    @check_args(int, str)
    @counted
    @staticmethod
    def frobnicate(foo, bar):
        pass



Proposed change requiring a space:



@ framework_stuff(lots of args)
class Quux(object):

    @ check_args(int, str)
    @ counted
    @ staticmethod
    def frobnicate(foo, bar):
        pass

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