mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-28 20:27:03 +00:00
we only need to declare a variable with `global` when we need to write to it, but if we just want to read it, there is no need to declare it. because the way how python looks up for a variable when reading from it enables python to find the global variables (and apparently the functions!). but when we assign a variable in python, the interpreter would have to tell in which scope the variable lives. by default the local scope is used, and a new variable is added to `locals()`. but in this case, we just read from it. so no need to add the `global` statement. see also https://docs.python.org/3/reference/simple_stmts.html#global Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>