A counter-counter-proposal for PEP 236: #pragma( nested_scopes)

Tim Peters tim.one at home.com
Thu Mar 1 14:30:26 EST 2001


[Warren Postma]
> Has anyone considered borrowing a C notation:
>
> #pragma( nested_scopes )
>
> Benefits:
>     - It's a comment therefore it doesn't break anything else.

But that's dead-wrong behavior for future_statements.  If your module needs
nested_scopes semantics, it will do unpredictable wrong things at runtime if
it doesn't get them.  That's why PEP 236 is emphatically *not* a "pragma"
proposal.  That doesn't mean a pragma facility isn't *also* desirable, but
does mean it's unsuitable for what PEP 236 is doing.  future_statements can
have profound effects on both syntax and semantics (indeed, that's what
they're *addressing*); they're not about pragmatics (from whence "pragma").

>     - It compiles fine and is ignored on pre-2.x systems.

Again dead-wrong behavior for future_statements.

>     - More pragmas can be added later, for warnings, code generation,
> etcetera.

Yes, pragmas can be useful for lots of things.  But not for cross-release
incompatible changes in semantics or syntax.





More information about the Python-list mailing list