Category Archives: Python

Alternatives to Single Function Classes

In Stop Writing Classes, a talk every Python engineer should watch, Jack Diederich tells us to avoid classes that have a single method, such as:

Jack suggests, rightly, that you can just define and call a function like this:

Sometimes, however, your function needs to accept a specific set of arguments. For example,… Read More »

The importance of “One Obvious Way”

In the face of ambiguity, refuse the temptation to guess. There should be one– and preferably only one –obvious way to do it. Although that way may not be obvious at first unless you’re Dutch. — Tim Peters, The Zen of Python >>> import this While Python has numerous advantages over other languages that make… Read More »