module-level variable

noun
UK /ˈmɒdjuːl ˈlɛvəl ˈvɛəriəbl/
US /ˈmɑːdʒuːl ˈlɛvəl ˈveriəbl/

A variable that lives in a whole file and can be used anywhere in that file.

The module-level variable stores the game's high score so every function can read it.


OTHER MEANINGS

2. A variable declared outside any function or class, shared by all code in its module.

She moved the counter to a module-level variable so both functions could update it.

3. A setting that keeps its value for the entire time a program file is loaded.

The module-level variable caches the database connection for reuse.

4. A name that is visible throughout a source file but not automatically in other files.

Unlike a true global, a module-level variable stays hidden unless it is exported.