correction to Python "file scope" #69

ianb opened this Issue Dec 28, 2016 · 0 comments


None yet

1 participant

ianb commented Dec 28, 2016

In this example:

g = 1

def incr_global():
  global g
  g += 1

The global variable is actually file (or more correctly "module") scoped, the same as for Node. You could not refer to g in another file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment