decorator with ```
sross at connectmail.carleton.ca
Thu Aug 12 13:32:14 CEST 2004
"Roman Suzi" <rnd at onego.ru> wrote in message
news:mailman.1555.1092303160.5135.python-list at python.org...
> One more crazy syntax before-def but which could be treated
> more generally:
> ```""" Factory for new decorator syntaxes.
> Keeps all proposals in a list and will recombine
> them at random if called without a spec. """
> def makeDecoratorSyntax(spec=None):
> raise NotImplementedException()
> New execution block type (in addition to exec, eval and
> interactive) could be added to allow needed behaviour.
I think it would be interesting if triple-back-ticks could be used to
introduce a kind of meta-scope, using 'this' to refer to the namespace being
operated upon (so you wouldn't have to spell out the object's name all the
time). For example:
```""" Factory for new decorator syntaxes.
Keeps all proposals in a list and will recombine
them at random if called without a spec.
this = staticmethod(this) # <- transformation explicit
this.author = "somebody" # <- add attributes normally
This idea could be used to do transformations on classes and modules as
More information about the Python-list