non-implicit globals -- missing feature

Helmut Jarausch jarausch at skynet.be
Mon Jun 16 16:06:40 EDT 2003


Hi,

I'm missing a feature (in many programming languages including
Python) that does not use global variables unless requested.

Is there any means in Python to catch errors like this following one?

x=1

# many many lines here

def mysub()
   # x=7   #forgot this assignment
   # ....
   anothersub(x)  # this uses the global x unfortunately
                  # how can I get an exception here ?

So I would prefer if there were an option / pragma
which say  # __no_implicit_globals__

Is there any way to get this behaviour?

Thanks for a comment

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany





More information about the Python-list mailing list