New PEP: The directive statement

Bruce Sass bsass at freenet.edmonton.ab.ca
Thu Mar 22 00:21:50 EST 2001


On Wed, 21 Mar 2001, Huaiyu Zhu wrote:
> With the __future__ PEP, I envision there could also be things like
>
> from __future__ import nested_scope
> from __experimentatal__ import stackless
> from __optional__ import static_type
> from __mandatory__ import string_methods
<...>
[an alternative]
> directive transitional nested_scope
> directive experimentatal stackless
> directive optional static_type
> directive mandatory string_methods
[or whatever]
<...>

Why was (something along the lines of)...

use:
    __future__.nested_scopes
    __experimental__.stackless
    __optional__.static_type
    __mandatory__.string_methods
except FutureError:
    # compensate for lack of nested scopes
except ExperimentalError:
    .
    .

...and allowing...

use:
    __future__.nested_scopes
    # code that relies on nested scopes
except FutureError:
    # code that does not use nested scopes

...rejected?  [It looks like a natural to me <shrug>...

<...>

> IMHO, reusing existing syntax is closer to Python than Perl, which
> introduces new syntax for many things that are only slightly different.

...and seems the most "Pythonic" of all.]


- Bruce





More information about the Python-list mailing list