PEP 443 has just been accepted. It brings a uniform API for creating and managing single-dispatch generic functions in Python 3.4. If the last sentence read to you like some Haskellish solution to a self-inflicted problem, this post is here to explain how generic functions may help you to organise real world code.
I received tickets for this year's edition of Enter Music Festival from my sister. The last few weeks have been so intense that when finally the time came to visit the festival, I was really surprised (seriously, it's the end of May already?).
All this somewhat raised my expectations ("since I'm here already, it better be good"). They haven't been totally fullfilled but let's start from the very beginning...
You cannot really lie in an advertisement. The FTC Bureau of Consumer Protection guards against using fraudulent techniques in advertising. I'm not sure whether it ever protected me. Seeing how ads work nowadays, I'm pretty sure the advertisers are always a step ahead of the bureau. You cannot lie but you can exaggerate about the desirable characteristics of your product and be silent about those less welcome. Selling is the art of manipulating the truth in a way that makes the product appear to satisfy the customers' requirements. Manipulation is the keyword here.
As we released Ralph as an open source project, new users started deploying it and very soon ran into an annoying problem. The output of each ralph command was preceeded with a meaningless message out of nowhere:
Error opening file for reading: Permission denied
Took me a while to identify the culprit and work around this.
During the weekend I participated as a mentor in a programming competition called HackFest 2012. A couple of thoughts on the event.
Specifying choices for form fields and models currently does not do much justice to the DRY philosophy Django is famous for. Everybody seems to either have their own way of working around it or live with the suboptimal tuple-based pairs. This Django enhancement proposal presents a comprehensive solution based on an existing implementation, explaining reasons behind API decisions and their implications on the framework in general.
import this is a brilliant easter egg in the Python interpreter. In just a few words it catches the philosophy behind what is considered "pythonic". One might argue that it describes the essence of what is so great about the language, its libraries and its community.
But for it to be more than just a bunch of aphorisms, a programmer has to ask herself: how do I conform to those guidelines in my daily work? I asked myself this question the other day and here are a few thoughts and opinions. Beware that this is at times very meta.