News for hackers. Stuff that matters.
Re:What the heck does "pythonic" mean? by vitno on Thursday August 23, 2012 @08:19AM (#4421938)
pythonic is easily summed up whenever you type 'import this'!

for those without a python interpreter handy:

>>> import this The Zen of Python, by Tim Peters

Beautiful is better than ugly.

Explicit is better than implicit.

Simple is better than complex.

Complex is better than complicated.

Flat is better than nested.

Sparse is better than dense.

Readability counts.

Special cases aren't special enough to break the rules.

Although practicality beats purity.

Errors should never pass silently.

Unless explicitly silenced.

In the face of ambiguity, refuse the temptation to guess.

There should be one-- and preferably only one --obvious way to do it.

Although that way may not be obvious at first unless you're Dutch.

Now is better than never.

Although never is often better than right now.

If the implementation is hard to explain, it's a bad idea.

If the implementation is easy to explain, it may be a good idea.

Re:What the heck does "pythonic" mean? by rbanffy on Thursday August 23, 2012 @09:23AM (#4422175)
BTW, I've been struggling with this: why smart people consider buildout pythonic and pip install -r unpythonic? Can anyone defend that position?

Would that change if I were Dutch?

Re:What the heck does "pythonic" mean? by rbanffy on Thursday August 23, 2012 @12:56PM (#4423438)
Just to be clear, this is a real question. I'd like someone who likes and uses buildout to engage in a constructive discussion about its merits.
Re:What the heck does "pythonic" mean? by slurgfest on Thursday August 23, 2012 @03:03PM (#4424247)
I don't think the Python community in general dictates the use of buildout at all. I reckon there are more supporters for pip install -r (although I would take correction). So the question becomes, why some smart people consider buildout Pythonic. I guess they just like it.
Re:What the heck does "pythonic" mean? by huxley on Thursday August 23, 2012 @04:50PM (#4424770)
Buildout came first and can do more things than pip can. If your workflow was heavily dependent on buildout, I could see how someone would see pip as inadequate. Buildout also came from the Zope community, so that will immediately break people up into camps.

My impression is also that more people use pip now particularly with its integration with virtualenv.

I can't imagine not developing with pip and virtualenv now.

Re:What the heck does "pythonic" mean? by tutuca on Thursday August 23, 2012 @08:43AM (#4422014)
Have you actually read the article?

It's quite clear that the author at least knows that.

Also, there is a general concensus that pep 0008 and the zen of python are not the only definition of pythonic.

Re:What the heck does "pythonic" mean? by fayden on Thursday August 23, 2012 @09:02AM (#4422096)
I believe his comment is intended to people reading the comments and not to the author.
Re:What the heck does "pythonic" mean? by ajross on Thursday August 23, 2012 @12:09PM (#4423145)
Brief para-literary digression:

I'm always amused when I read this. All of it is straightforward advice and good when applied sanely, of course. But... the whole thing just drips with an insecurity complex over perl. Where Larry & Co. were shocking the world with the cacophany of TMTOWTDI and their Laziness, Impatience and Hubris, the python people just look... scared of all that stuff.

So they have this meek list instead. There's sanity here, but no poetry. I think this explains my reaction to python every time I'm forced to use or maintain it -- there's no fun in the language, just proscription. Programming should be fun, right?

Re:What the heck does "pythonic" mean? by softbuilder on Thursday August 23, 2012 @12:34PM (#4423319)
>the whole thing just drips with an insecurity complex over perl.

JAPH to Pythonista convert here. I think it definitely is a reaction to Perl, but the "insecurity complex" phrasing has its own insecurity complex peeking out. The Zen dates from 2004, when the writing was on the wall for Perl. (That writing on the wall was in Ruby, Python, and PHP.) Very little to feel insecure about by then.

Also, beauty and simplicity are hardly meek values, but I understand the subjectivity. To each his own.

Re:What the heck does "pythonic" mean? by unwind on Thursday August 23, 2012 @08:44AM (#4422020)
My interpretation of "Pythonic" is "idiomatic in Python". It's just a simple mashup of the two words, with the added bonus of being quite easy to say, and perhaps sounding cool/interesting/appealing.

It's a bit harder for us poor C programmers to come up with a matching term. "C-nic" (rhymes with "scenic") just looks weird, but of course the double meaning would be amusing: "this code doesn't look very C-nic"!

Re:What the heck does "pythonic" mean? by vetler on Thursday August 23, 2012 @08:27AM (#4421966)
I'm surprised PEP-8 wasn't mentioned. When I used to do Python development, this was the main reference for "pythonic" code conventions.

http://www.python.org/dev/peps/pep-0008/

Re:What the heck does "pythonic" mean? by andreasvc on Thursday August 23, 2012 @08:47AM (#4422032)
Better submit the original link from 2005. I couldn't use the arrow key on this one which is always annoying.
Re:What the heck does "pythonic" mean? by bitwize on Thursday August 23, 2012 @09:33AM (#4422226)
To me "Pythonic" means "according to the values of the Python community". More than idiomatic, there is a set of normative values involving design, interfaces, etc. inherent in the term "pythonic" and the judgement it implies.
Re:What the heck does "pythonic" mean? by snprbob86 on Thursday August 23, 2012 @11:33AM (#4422906)
I think it's valuable for a community to have such a word or phrase. Companies should have such a phrase too.

Google has "Googley", Apple has "doesn't suck" and "insanely great"; those phrases get used to justify a level of engineering and design respectively that truly sets those companies apart. The phrase itself is adequate to summon the higher bar of the phrase's respective auteur.

Re:What the heck does "pythonic" mean? by dguaraglia on Sunday August 26, 2012 @04:45AM (#4434678)
Hm, I guess 'Pythonic' is also highly subjective. It's one of those things that "you'll know when you see it" but it's almost impossible to describe in words. I've seen code that rigorously complied to PEP8, had a lot of the constructs described in the article and still managed to look like C code. It wasn't "bad" code, mind you. It just wasn't Pythonic enough. Go figure!
Re:What the heck does "pythonic" mean? by hack_edu on Thursday August 23, 2012 @10:16AM (#4422456)
Off-topic, but why do so many sites still use static layouts that break when zoomed in with a mobile browser. The choice of font on this post is too small to read without zooming in, but his little static box forces itself on top and of the actual text content. Perhaps this isn't a problem in other mobile browsers? Using Chrome on Android...
Re:What the heck does "pythonic" mean? by X-Istence on Thursday August 23, 2012 @12:32PM (#4423304)
I'm reading in Safari and all of the content is a single bar down the left side, all squeezed together taking up very little of the viewport...

It made it difficult to read as well. The huge whitespace on the right of the article is extremely distracting.

Re:What the heck does "pythonic" mean? by will_work4tears on Thursday August 23, 2012 @09:54AM (#4422330)
When I hear the term, I think in Greek terms:

Of or resembling an oracle; prophetic.

Re:What the heck does "pythonic" mean? by dllthomas on Thursday August 23, 2012 @03:06PM (#4424268)
From the Greek, I think it would be "rotten".
Re:What the heck does "pythonic" mean? by jackolas on Thursday August 23, 2012 @09:30AM (#4422207)
"New codebase... Twisted." Is this satire?