Articles by Steven Loria

Lazily-evaluated Property Pattern in Python

Lazy evaluation is a useful pattern that can improve your code's efficiency in many situations.

One example of this is instance attributes that take long to compute:

This approach may cause initialization to take unnecessarily long, especially when you don't always need to access Person#relatives.

A better strategy would …

Python Best Practice Patterns by Vladimir Keleshev (Notes)

These are my notes from Vladimir Keleshev's talk entitled "Python Best Practice Patterns", given on May 2, 2013 at the Python Meetup in Denmark. The original video is here (about 38 minutes long).

Note: Some of the code examples have been has been modified from the original presentation based on …

A professional reinvents himself

A professional reinvents himself…the professional does not permit himself to become hidebound within one incarnation, however comfortable or successful. Like a transmigrating soul, he shucks his outworn body and dons a new one. He continues his journey. Steven Pressfield, The War of Art