function with a state

Xah Lee xah at
Sun Mar 6 09:07:05 CET 2005

is it possible in Python to create a function that maintains a variable

something like this:

def myFun():
  return globe

apparently it can't be done like that. I thought it can probably be
done by prefixing the variable with some package context...

the Python doc is quite stilted. Where in the python doc is a programer
supposed read about how the package/module system in Python works?
(besides the tutorial that touches it)

 xah at

More information about the Python-list mailing list