[Python-Dev] Plea for simpler decorator syntax, in addition to pie-shaped syntax (original) (raw)
Fred L. Drake, Jr. fdrake at acm.org
Wed Aug 4 17:00:34 CEST 2004
- Previous message: [Python-Dev] Plea for simpler decorator syntax, in addition to pie-shaped syntax
- Next message: [Python-Dev] Plea for simpler decorator syntax, in addition to pie-shaped syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wednesday 04 August 2004 10:52 am, Jim Fulton wrote:
IMO, the most common uses of decorators will be to define properties, and class and static methods. IMO, these uses would be better served by a simpler syntax:
def classmethod foo(cls, ...): ...
This was rejected a long time ago because it complicated life for editor colorizing support and many similar tools. It especially complicates the creation of ad-hoc tools, and breaks ones that are already working.
While pie-notation isn't my favorite, it's reasonable enough. The example
@classmethod
def makeAnother(cls):
return cls("magic", 42)
seems readable enough to me.
-Fred
-- Fred L. Drake, Jr.
- Previous message: [Python-Dev] Plea for simpler decorator syntax, in addition to pie-shaped syntax
- Next message: [Python-Dev] Plea for simpler decorator syntax, in addition to pie-shaped syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]