Latest Articles - Programming

Teaser image

The previous articles about the topic of Python function attributes gave an example of how a decorator can be used to add functionality to a given function using function attributes. It then introduced an alternative approach using classes, and no function attributes, to achieve similar functionality.

The purpose of this article is to examine these two approaches in-depth to see if they hold up as "interchangeable", or if perhaps one approach has distinct advantages over the other. At its end, I'll share my view on the status of function attributes. Read more...



Teaser image

Function attributes are a relatively little-known corner of the Python language. Ultimately, this is because most of the problems they may solve are arguably better solved by a different approach (as will be shown). However, understanding why they exist may highlight some interesting cornerstones of Python's design to beginners or even intermediate users.

Prior to beginning, I'd like to make it clear that my purpose is not to proselytize, merely inform. Function attributes appears to be a topic that has not been blogged-to-death so I thought they might be worthwhile to discuss at some length. Read more...



Teaser image

It may be tempting to assume that def foo makes available the name foo to the function block every time it is run, similar to how for x in ... would make the name x available inside a for block. This is not the case, however: Read more...


Teaser image

pip is an incredibly handy package manager for Python. As of Python 3.4, it is included with default distributions of Python.1 Once you are used to using it, you will miss having it when stuck working with older versions.

Fortunately, pip can be installed to pre-3.4 versions of Python in a few simple steps. Oddly enough, though the process is simple, a complete solution wasn't easily available (via very quick Googling, anyway) so I'll write the process here. Read more...


« Page 2 / 3 »