A counter-proposal to __future__ in PEP 236

Tim Peters tim.one at home.com
Thu Mar 1 18:53:41 EST 2001


[Tim]
> from __future__ import nested_scopes
> assert nested_scopes[1] > sys.version_info, "don't need this anymore"

[William Tanksley]
> Is it really important that information such as this be stored as a tuple
> rather than a dict (with symbolic names rather than numbers)?

No.  Just another attempt to avoid hypergeneralizing PEP 236 into uselessness
<0.7 wink>.

> assert nested_scopes.version_info > sys.version_info, \
>                             "don't need this anymore"

See?  You started with "dict" but have already generalized to class instance.

> I've always been taught that magic numbers are unpleasant.

That's only because they're obscure and make things hard to change <wink>.  I
think I will make it a class instance -- thanks!





More information about the Python-list mailing list