[Python-checkins] CVS: python/dist/src/Doc/ref ref6.tex,1.50,1.51

Guido van Rossum guido@python.org
Mon, 01 Apr 2002 16:49:58 -0500


> Modified Files:
> 	ref6.tex 
> Log Message:
> Note the sole case in which the ban on "from ... import *" within a
> function is enforced.
> 
> 
> Index: ref6.tex
> ===================================================================
> RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref6.tex,v
> retrieving revision 1.50
> retrieving revision 1.51
> diff -C2 -d -r1.50 -r1.51
> *** ref6.tex	1 Apr 2002 21:18:02 -0000	1.50
> --- ref6.tex	1 Apr 2002 21:19:44 -0000	1.51
> ***************
> *** 681,685 ****
>   (\character{_}).
>   
> ! The \keyword{from} form with \samp{*} may only occur in a module scope.
>   \kwindex{from}
>   \stindex{from}
> --- 681,689 ----
>   (\character{_}).
>   
> ! The \keyword{from} form with \samp{*} may only occur in a module
> ! scope.  If the wild card form of import --- \samp{import *} --- is
> ! used in a function and the function contains or is a nested block with
> ! free variables, the compiler will raise a \exception{SyntaxError}.
> ! 
>   \kwindex{from}
>   \stindex{from}

Hm...  Maybe this is a situation where appropriate use of should and
shall would be clearer?

--Guido van Rossum (home page: http://www.python.org/~guido/)