Honestly, I hate the word "Pythonic" -- it's used as a simple synonym of "good" in many circles, and I think that's pretentious. Those who use it are silently saying that good code cannot be written in a language other than Python. Not saying Python is a bad language, but it's certainly not the "end all be all language to solve ALL of everyone's problems forever!" (Because that language does not exist). What it seems like people who use this word really mean is "idiomatic" rather than "Pythonic" -- and of course the word "idiomatic" already exists. Therefore I wonder: Why does the word "Pythonic" exist?
-
3Maybe Python coders have a stumped vocabulary :) – James Love Feb 14 '11 at 22:18
-
6Maybe you need to look at the etymology. Before the language was named after a comedy troupe famous for their Flying Circus, the adjective Pythonic was used in reference to that troupe's work and that of others who were influenced by them. – Peter Taylor Feb 14 '11 at 22:25
-
8Dude, feel free to call your own code Rubic, Prologic, Clojuric, Lispic, Javic, CiPluPluic, basic, perlic, erlangic, htmlic, CSSic, JavaScriptic, BrainFuckic, SeeSharpic, Dic, Cic, batic, shellic, bashic, powerShellic, efsharpic, schemic, pascalic, cobolic, adic, dosic, luaic ... I think I missed 7 languages. – Job Feb 14 '11 at 22:49
-
4I've seen many people (on SO, mostly) start out saying they're going to write this in a "Pythonic way", then proceed to write absolutely *horrible* Python code (as far as being readable and idiomatic goes) just because they want to condense everything to certain features (e.g. list comprehensions or lambdas). Don't let these people unfairly color your view. Example: http://stackoverflow.com/q/4854588 – Fred Nurk Feb 19 '11 at 07:25
-
I don't know, I happen to find the upvoted examples on that question fairly readable. – Andrea Mar 27 '12 at 08:49
-
I think the word comes from the early years of Python, when it was usually contrasted with Perl. The view was that in Perl people would try to condense their code into as few characters as possible, but for Python readability was most important and the view was that that would be achieved by writing things out more. It was slightly broader than just idiomatic Python construct. Of course that meaning is completely lost nowadays. – RemcoGerlich Jul 09 '14 at 10:15
2 Answers
Those who use it are silently saying that good code cannot be written in a language other than Python.
No, those who use it are saying "this looks like good Python code". Nothing more, nothing less. It applies in the context of Python code. It's used to contrast code that uses Python idioms to code that doesn't use Python idioms.
Yes, if you were to write Python code as though it's, say, Java, it would probably be described as "not Pythonic". This is not to say that Java code written like Java code is ugly, or that anything not written in the Python style is ugly; it's to say that Python code not written using Python idioms is not Pythonic.
"Pythonic" is synonymous with "idiomatic", but more specifically, it's synonymous with "idiomatic Python".
"Pythonic" does not say anything about code written in other languages.

- 7,493
- 36
- 35
-
5+1 ... except "Pythonic" is probably a **bad** thing in other languages. :) – Michael Urman Feb 15 '11 at 14:47
-
@Michael: Not the way I've seen it used. The people around where I live use the word "pythonic" for everything, not just python. – Billy ONeal Feb 17 '11 at 17:33
-
Checking this because I really don't know the answer, and it seems to have garnered a lot of votes. – Billy ONeal Feb 17 '11 at 17:34
-
8@Billy ONeal: If someone's using the word "pythonic" to describe code written in languages other than Python, they don't know what the word even means. They probably read it on a blog somewhere and want to sound cool. – mipadi Feb 18 '11 at 17:24
Idiomatic isn't specific. Pythonic refers specifically to the idioms that Python supports via its structure, syntax and libraries.
And yeah, it's a little pretentious.

- 3,002
- 20
- 21