decorators when?

Dan Bishop danb_83 at yahoo.com
Wed May 28 02:46:07 EDT 2008


On May 27, 7:32 pm, Kam-Hung Soh <kamhung.... at gmail.com> wrote:
> David C. Ullrich wrote:
> > What version added decorators (using the
> > @decorator syntax)?
>
> > (Is there a general way I could have found out the answer myself?)
>
> > Is there a somthing such that "from __future__ import something"
> > will make decorators work in 2.5.2?
>
> > David C. Ullrich
>
> See:
>
> http://www.python.org/doc/2.4/whatsnew/whatsnew24.html
>
> Dunno of a general way view a list of features versus releases, other
> than reading the "What's New in Python x" documents.  Maybe some
> enterprising developer can compile this list?  Hint, hint.

>>> [feature for feature in vars(__future__).items() if isinstance(feature[1], __future__._Feature)]
[('nested_scopes', _Feature((2, 1, 0, 'beta', 1), (2, 2, 0, 'alpha',
0), 16)),
 ('division', _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0),
8192)),
 ('with_statement', _Feature((2, 5, 0, 'alpha', 1), (2, 6, 0, 'alpha',
0), 32768)),
 ('absolute_import', _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0,
'alpha', 0), 16384)),
 ('generators', _Feature((2, 2, 0, 'alpha', 1), (2, 3, 0, 'final', 0),
0))]




More information about the Python-list mailing list