decorators when?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue May 27 11:09:13 EDT 2008


En Tue, 27 May 2008 11:52:25 -0300, David C. Ullrich  
<dullrich at sprynet.com> escribió:

> Oh. Never mind the details, let's just say that having 2.3 and
> 2.5 installed on the same machine can lead to confusion
> about exactly which one you're running a script under.
> Duh.

You might change the prompt; put these lines in your sitecustomize.py (or  
create it if you don't have one):

import sys
sys.ps1 = 'p23> '
sys.ps2 = ' ... '

> Sorry. Thanks. I don't suppose that decorators are available
> from __future__ somehow in 2.3?

No. But a decorator is only syntax sugar.

@decorator
def f():
   ...

is the same thing as:

def f():
   ...
f = decorator(f)

(just more convenient)

-- 
Gabriel Genellina




More information about the Python-list mailing list