clarkgrubb / hyperpolyglot

hyperpolyglot.org
Other
473 stars 94 forks source link

correction to Python "file scope" #69

Open ianb opened 7 years ago

ianb commented 7 years ago

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.