correction to Python "file scope" #69

Open
ianb opened this Issue Dec 28, 2016 · 0 comments

Projects

None yet

1 participant

@ianb
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