Category Archives: Python Globals

A Globals Module pattern

Two comments on my recent posts on a Globals Class pattern for Python and an Arguments Container pattern reminded me that there is one more container for globals that is worth noting: the module. The idea is a simple one. You … Continue reading

Posted in Python Globals

An Arguments Container pattern

In a comment on my earlier post A Globals Class pattern for Python, Mike Müller wrote “No need for globals. Just explicitly pass your container. In my opinion this is much easier to understand.” Mike’s comment led me to some … Continue reading

Posted in Python Globals | 5 Comments

A Globals Class pattern for Python

I’ve gradually been evolving a technique of coding in which I put module globals in a class. Recently I stumbled across Norman Matloff’s Python tutorial in which he recommends doing exactly the same thing, and it dawned on me that … Continue reading

Posted in Python Globals | 8 Comments