[EuroPython] What the heck does "pythonic" mean?

Dario Lopez-Kästen dario at ita.chalmers.se
Tue Apr 12 06:39:50 CEST 2005


Magnus Lycka wrote:
>>How do you judge if something is "pythonic" or not?
> 
> Typing "import this" at the python prompt is a good beginning.
> 
> I'm sure others can explain this better, but using Zope is
> certainly a very different experience than "normal" Python
> programming.
> 
> It's always different to work with a "plain" programming
> environment where you "own main()", where you write the code
> which is in charge, and use various libraries to handle various
> aspects of your problem, compared to working with a framework
> such as Zope.
> 
> Every framworks imposes an overhead and its own paradigm, but
> I think Zope might initially feel more strange to Python
> programmers than other frameworks, since it takes quite a while
> before you even get close to coding Python in it... With 
> something like Twisted, you are also inside the bounds of a
> framework, and you have to play by its rules, but at least you
> are writing Python code that you save as normal text files from
> the very start. You are not clicking around in some odd HTML
> interface filling in various forms...

But nowadays I do the above every day when I am programming Zope. I am 
writing all my code in the Filesystem and then i either CVS or SVN it; 
for instance I am using a library  that is used in a standalone python 
CLI tool and building a web interface to int using Zope/Plone.

And for the application that I am building it is not at all CMS 
oriented, it is a an interface to our custom Directory Services and user 
account system. In this particular case Zope is used only for it's Web 
functions.

Is this not "Pythonic" in the sense you mean?

Now, the very same thing you criticise is what I think is a major bonus 
point for Zope. Providing ease of use for the end user. I also am one of 
the maintainer of big application entirely built with TTW code and 
templates, and yes, it is not as easy to maintain as FS code, but I do 
not make religious war over it.

 From my point of view, I find the notion of dismissing Zope just 
because  it provides an alternative way of development for end users a 
bit strange. Zope provides a full blown environment for all kinds of 
users, hardcore hackers and end users alike, so I still don't know what 
people mean with Zope not being pythonic.

Maybe people have a hard time understanding that Zope is not *only* for 
the Python programmer?

> Besides "The Zen of Python", I think most Python programmers
> live more or less in accordance with the Unix Philosophy. I
> can recommend Mike Gancarz' book The UNIX Philosophy, or you
> can look at http://linuxfinances.info/info/unix.html or
> http://www.faqs.org/docs/artu/ch01s06.html for some clues.
> Python goes far beyond pipes, but trying to keep things small
> and simple, avoiding big monolithic programs and keeping data
> and code as text files are examples of things that seem Pythonic
> to me, but is violated by Zope.

Well, my impression is that this is not 100% true for many python 
programmers:

" Store numerical data in flat ASCII files " - that was easy to say a fw 
years back when the world was simpler than it is today. But then Object 
orientation came along, and people started to speak of "persistence" and 
  "serialisation", and different techniques to store objects for easy 
consumption, this did not become 100% necessary.

Of course, with XML, it is easier to do.

> Perhaps a "Spirit of Python" talk would be useful at the conference.
> 


-- 
-- -------------------------------------------------------------------
Dario Lopez-Kästen, IT Systems & Services Chalmers University of Tech.
"...and click? damn, I need to kill -9 Word again..." - b using macosx


More information about the EuroPython mailing list