Python handles globals badly.

Emile van Sebille emile at fenx.com
Wed Sep 2 15:34:23 EDT 2015


On 9/2/2015 11:47 AM, tdev at freenet.de wrote:
<snip>
> I therefore would like to see a PEP which allows also writing
> global module vars inside module functions without the need
> for explicit setting the keyword "global" in more or less each(!)
> module function as the first line of code.

If you're feeling like you need to add global statements to a lot of 
functions to enable variable sharing/access, it may be codesmell 
indicating it's time to make a class of things.

Emile






More information about the Python-list mailing list