Many references around the web refer to something as "unpythonic". Sometimes the thing that's referred to as unpythonic is a framework written in Python like Zope. Sometimes it's a configuration pattern (most recently the use of "configure; make; make install" vs. "python setup.py install" on the zope-dev list). Sometimes it's a small bit of code written in Python (e.g. things that overuse Python's functional keywords like "map", "filter", "reduce", "lambda" etc). Sometimes it's an API (e.g. the XML DOM).
The concept of "Pythonic" itself is meaningless. Even Guido can't define it :
Guido van Rossum: That's a really tough question. One example of an API design I found unsatisfactory is the DOM API for dealing with XML. That originally started in the Java world. I'm not sure if the problems with it are the same in the Java version as they are in the Python version. I have a feeling that the Python translation of the DOM API was actually done by sticking too closely to the Java version, and thereby being unpythonic, which is a completely undefined term. Bill Venners: But you know it when you see it. Guido van Rossum: That's exactly the problem. I can't teach anyone else what makes a pythonic interface.
I think the definition of "unpythonic" is actually closest in spirit to the definition of "obscene". Nobody can define it but everybody thinks they know what it is when they see it. At its worst, I've seen people wield the term "unpythonic" as a stick to beat other people and technologies with (while of course having no other viable solution to the problem at hand). At its best, I've seen people wield the term to justify making small changes to things to make them easier to use. At the end of the day, I'd rather that people didn't use the term in public forums as if it was a well-understood concept, because it's pretentious and suggestive. Instead, just enumerate concretely what's wrong with the thing you're beating up with the "unpythonic" stick and suggest ways to fix it; you can skip the pretension.
Taking things this literally, no matter how entertaining, is not really credible, however. I do think it demonstrates that there is something that defines Python beyond CPython. Of course this thing is not formalized anywhere, hence the need for this vague word to indicate exclusion from its prinicples. It's a really more about aesthetics than anything. Fashions come and go, and at one time functional programming was fashionable to pythonistas. Now it is not. Surely there are things currently considered pythonic that will one day be "so last Friday".
Replies to this comment