-
Recent Posts
- Workaround for flask/babel/sphinx bug on Python 3+
- enum in Python
- Python Decorators
- Unicode – the basics
- Python’s magic methods
- Gotcha — Mutable default arguments
- Unicode for dummies — Encoding
- How to post source code on WordPress
- Python3 pickling
- Yet Another Lambda Tutorial
- Read-Ahead and Python Generators
- In Java, what is the difference between an abstract class and an interface?
- Newline conversion in Python 3
- Why import star is a bad idea
- Learning Subversion: the mystery of .svn
- How to fix a programmable Northgate keyboard
- Northgate keyboard repair
- An alternative to string interpolation
- A Globals Module pattern
- An Arguments Container pattern
- A Globals Class pattern for Python
- How to open a web browser from Python
- Command-line syntax: some basic concepts
- Unicode for dummies – just use UTF-8
- Unicode Beginners Introduction for Dummies Made Simple
- Multiple constructors in a Python class
- How do I reverse a string in Python 3?
- What’s wrong with use cases?
- Python Packages
- Diagram arrangements
- Python & Java: A Side-by-Side Comparison
- Static vs. dynamic typing of programming languages
- Debugging in Python
- Introduction to Python Decorators
- Gotcha — forgetting parentheses
- Gotcha — backslashes in Windows filenames
- Gotcha — backslashes are escape characters
- Python Gotchas
Categories
- Decorators (2)
- Java and Python (3)
- Keyboards (2)
- Miscellaneous (2)
- Moving to Python 3 (3)
- Python & JSD (1)
- Python debugger (1)
- Python features (9)
- Python Globals (3)
- Python gotchas (5)
- Software Development (2)
- Subversion (1)
- Unicode (4)
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
Comments Off on A Globals Module pattern
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