Definition of Pythonic?

E

Emmanuel Surleau

Hi there,

I'm starting an exploratory foray into Python, being generally dissatisfied
with the Ruby ecosystem (while the language is wonderful, third party
libraries and documentation are not).

Having written a few trivial scripts in Python, I'm curious as to how you
would sum up the Pythonic philosophy of development. Judging from Python, it
seems to exclude (mostly) "magical" variables like '$.'. Is this right? What
else would you include in this definition?

Cheers,

Emm
 
A

Aahz

Having written a few trivial scripts in Python, I'm curious as to how you
would sum up the Pythonic philosophy of development. Judging from Python, it
seems to exclude (mostly) "magical" variables like '$.'. Is this right? What
else would you include in this definition?

python -m this
 
J

John Yeung

Having written a few trivial scripts in Python, I'm curious as
to how you would sum up the Pythonic philosophy of development.

A couple of others have already mentioned the Zen of Python, available
at the Python command prompt. I would agree with that, but also add
the caveat that none of the principles expressed there are hard-and-
fast rules. Hopefully that is clear from the quasi-contradictory
nature of the principles, but inevitably there will be some people who
complain that Python breaks this or that "rule" from the Zen.

The fact is, it's impossible to satisfy every principle in every
situation. To me, Python distinguishes itself for how well it
balances all of them. "Compromise" is a word that comes up a lot when
talking about the design of Python. To some, that has a negative
connotation; to me, it's an inevitable consequence of being practical.

John
 
M

MRAB

John said:
A couple of others have already mentioned the Zen of Python, available
at the Python command prompt. I would agree with that, but also add
the caveat that none of the principles expressed there are hard-and-
fast rules.

"Special cases aren't special enough to break the rules.
Although practicality beats purity."

This also applies to the Zen itself.
 
E

Emmanuel Surleau

A couple of others have already mentioned the Zen of Python, available
at the Python command prompt. I would agree with that, but also add
the caveat that none of the principles expressed there are hard-and-
fast rules. Hopefully that is clear from the quasi-contradictory
nature of the principles, but inevitably there will be some people who
complain that Python breaks this or that "rule" from the Zen.

Thank you all for the nice and prompt replies to what is a typical newbie
question, which is bound to come back regularly. And no, you can't make
everybody happy, per definition.
The fact is, it's impossible to satisfy every principle in every
situation. To me, Python distinguishes itself for how well it
balances all of them. "Compromise" is a word that comes up a lot when
talking about the design of Python. To some, that has a negative
connotation; to me, it's an inevitable consequence of being practical.


That's fine with me: after all, you can't do software engineering without
trade-offs.

Cheers,

Emm
 
M

Mark Wooding

John Yeung said:
A couple of others have already mentioned the Zen of Python, available
at the Python command prompt. I would agree with that, but also add
the caveat that none of the principles expressed there are hard-and-
fast rules.

Indeed, I'd suggest that the very lack of hard-and-fast rules is typical
of the Python approach.
The fact is, it's impossible to satisfy every principle in every
situation. To me, Python distinguishes itself for how well it
balances all of them. "Compromise" is a word that comes up a lot when
talking about the design of Python. To some, that has a negative
connotation; to me, it's an inevitable consequence of being practical.

Agreed. Then again, all language design is a compromise, between
factors like runtime efficiency, simplicity of implementation,
tractability of semantics (for various classes of users), supportability
by tools, and expressive power. Python inhabits what seems to me to be
a particularly sweet spot on this rather complex landscape.

-- [mdw]
 
L

Lawrence D'Oliveiro

Pythonic--an acid, capable of reacting with bases to form pythanates?

Would it be an organic or inorganic acid?

Deprive it of a bit of oxygen, and it becomes pythonous, reacting to form
pythonites.

What do you mean, the fume cupboard's broken down? Honestly I feel fine...
 
G

Gabriel Genellina

En Sun, 12 Apr 2009 08:16:19 -0300, Lawrence D'Oliveiro
Pythonic--an acid, capable of reacting with bases to form pythanates?

Would it be an organic or inorganic acid?

Deprive it of a bit of oxygen, and it becomes pythonous, reacting to form
pythonites.

What do you mean, the fume cupboard's broken down?
Definitely!

Honestly I feel fine...

Sure... just don't drive :)
 
F

Francesco Bochicchio

John Yeung ha scritto:
A couple of others have already mentioned the Zen of Python, available
at the Python command prompt. I would agree with that, but also add
the caveat that none of the principles expressed there are hard-and-
fast rules. Hopefully that is clear from the quasi-contradictory
nature of the principles, but inevitably there will be some people who
complain that Python breaks this or that "rule" from the Zen.

I believe the almost-contraddictory nature of the various listed
principles is on-purpose. My anecdotal knowledge of the Zen tells me
that is based on the balance of two 'opposing forces', the Yin and the
Yang. So the 'zen of python' attempts to enunciate the various yins and
yangs of software development, leaving to the developers the task of
finding the right equilibrium among them.

Which is pretty sensible, since good engineering is often based more on
choosing the right trade-off rather than choosing the One Right Thing to do.

Ciao
 
L

Lawrence D'Oliveiro

Francesco Bochicchio said:
Which is pretty sensible, since good engineering is often based more on
choosing the right trade-off rather than choosing the One Right Thing to
do.

Yes, but remember that, too, is a tradeoff. Moderation is fine, but don't
carry it to extremes. You can never have too much moderation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top