[Patches] [ python-Patches-404997 ] Alternative to __future__ imports

noreply@sourceforge.net noreply@sourceforge.net
Mon, 19 Mar 2001 20:04:32 -0800


Patches item #404997, was updated on 2001-02-28 13:57
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=404997&group_id=5470

Category: Parser/Compiler
Group: None
Status: Open
Priority: 5
Submitted By: Martin v. Löwis (loewis)
Assigned to: Tim Peters (tim_one)
Summary: Alternative to __future__ imports

Initial Comment:
This patch adds an alternative notation for selecting
nested scopes on the module level, by means of a 

directive nested_scopes

declaration. This is a declaration, and it may only
appear at the "beginning" of a module. Even though it
adds a keyword "directive", this is only a keyword if
it appears as the first keyword in the file; as a
result, 

def directive():
  directive = 1

is still accepted (even without warning, but that could
be changed if desired).

The patch currently only accepts the directives that
are also __future__ imports, although it can be
extended to allow other things, e.g.

directive source_encoding "latin-1"

This is possible since the syntax allows an optional
atom after the directive's name.

----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2001-03-19 20:04

Message:
Logged In: YES 
user_id=31435

Trying to attach the patch (for whatever reason, it took 
about 15 minutes to retrive it from the URL given).

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2001-02-28 22:09

Message:
Logged In: YES 
user_id=21627

Sigh. The patch is now at
http://www.informatik.hu-berlin.de/~loewis/python/directive.diff

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2001-02-28 22:06

Message:
Logged In: YES 
user_id=21627

Retry uploading the patch

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=404997&group_id=5470