the global keyword:

Steven D'Aprano steve at pearwood.info
Mon Jun 20 08:03:18 EDT 2016


On Mon, 20 Jun 2016 08:21 pm, BartC wrote:

> On 19/06/2016 18:16, Joel Goldstick wrote:
> 
>> People who understand global variables generally avoid using them at
>> all costs.
> 
> Then perhaps they don't understand that in Python, top-level functions,
> classes and imports are also globals.

But not global *variables*. They are generally used as per-module global
*constants*, or at least near-constants.



-- 
Steven




More information about the Python-list mailing list