Latest articles tagged function-attributes

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...