Rather than decorators, how about sections?
paolo_veronelli at yahoo.it
Wed Aug 11 21:38:48 CEST 2004
On Wed, 11 Aug 2004 13:10:53 -0400, Paul Morrow <pm_mon at yahoo.com> wrote:
> Stefan Eischet wrote:
>> do we really need this stuff just to say "staticmethod" and
>> "classmethod"? How about:
>> class Foo(object):
>> def baz():
>> print "Static Method"
>> def bar(self):
>> print "Method"
>> def spam(Foo):
>> print "Class Method"
> I like it! It's simple, clear, ... Why isn't this the hands-down best
> solution? Why do we want to be more verbose than necessary?
> I wonder if there are people out there who've chosen something other
> than *self* for the 1st arg (shame on them if they did! <grin>) who's
> code this would break. I've never understood why we didn't require that
> it be called self in the first place --- why give them more than one way
> to do *that*?
I do and I'm happy with that .Actually it took me a while to understand
that self was just the medio man choice which I really use now only for
I usually use capitalized names for classes and same name not capitalized
as first argument ,after a while it became much easy for me to understand
where I was reading in the code .... now should I say shame on you because
you like self? Take it easy with words and have fun.
....lotta dura per la verdura
More information about the Python-list