decorator with ```

Roman Suzi rnd at onego.ru
Thu Aug 12 05:32:28 EDT 2004


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. """
   staticmethod```
def makeDecoratorSyntax(spec=None):
    raise NotImplementedException()

New execution block type (in addition to exec, eval and
interactive) could be added to allow needed behaviour.

Less-decorated are also fine:

```staticmethod```
def makeDecoratorSyntax(spec=None):
    raise NotImplementedException()

Several block could also concatewnate:

```staticmethod```
```decor2```
def makeDecoratorSyntax(spec=None):
    raise NotImplementedException()

Or use ; to put them into one line:

```staticmethod; decor2```
def makeDecoratorSyntax(spec=None):
    raise NotImplementedException()


Of course, the same could be put AFTER def, like docstring.

Sincerely yours, Roman A.Suzi
-- 
 - Petrozavodsk - Karelia - Russia - mailto:rnd at onego.ru -




More information about the Python-list mailing list