decorator J4 - any objections?
Martin DeMello
martindemello at yahoo.com
Sat Aug 21 06:20:20 EDT 2004
Paul Rubin <http://phr.cx@nospam.invalid> wrote:
> Martin DeMello <martindemello at yahoo.com> writes:
> > > def func(arg1, arg2)
> > > @version("Added in 2.4")
> > > @returns(None):
> > >
> > > """Docstring could be here, or in decorator part above"""
> > > # body goes here
> >
> > It's really nice to have an outdented marker for when the actual
> > function body begins.
>
> I don't really see why, but the decorators don't have to be indented:
>
> def func(arg1, arg2)
> -version("Added in 2.4")
> -returns(None):
>
> """Docstring could be here, or in decorator part above"""
> # body goes here
>
> I guess that's ugly though.
Yep. What I love about J4 is it lets you scan a file very quickly,
jumping from function to function and to the body when you find the one
you want. Very little visual clutter.
martin
More information about the Python-list
mailing list