Josh Rosenberg <shadowranger+pyt...@gmail.com> added the comment:

Serhiy: There is a semi-common case where global constants can be quite 
expensive, specifically, initializing a global full of expensive to 
compute/serialize data so it will be shared post-fork when doing 
multiprocessing on a POSIX system. That said, that would likely be a case where 
lazy initialization would be a problem; you don't want each worker 
independently initializing the global lazily.

Also, for all practical purposes, aren't enums and namedtuples global constants 
too? Since they don't rely on any syntax based support at point of use, they're 
just a "function call" followed by assignment to a global name; you couldn't 
really separate the concept of global constants from enums/namedtuple 
definitions, right?

----------
nosy: +josh.r

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33124>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to