It Fits Your Brain: the Ninth Annual International Python Conference
The Ninth Annual International Python Conference was held March 5-8, 2001, at the Long Beach Hilton in Long Beach, California. Over 300 people attended. This article covers some observations made by a web developer, with a special emphasis on the funny things that were said. In case some of you are unaware, Python is a programming language; its home page is www.python.org, and a helpful tutorial is posted there.
Guido van Rossum, Python's BDFL (Benevolant Dictator for Life), introduced the conference theme, "Python Fits Your Brain"--not everybody's brain, but at least the brains of those who like it. Guido has always preferred to make the language work well for its adherents (and especially for himself) rather than try to please everybody. Not only programmers but also artists, scientists and teachers are finding Python well suited for their work.
PythonLabs, the team of core Python developers, is now happily situated at Digital Creations, the company that makes Zope. (Zope is a web application server written in Python; see their web site.) Those who fear Python might become straightjacketed to Zope's wishes need not be concerned. Zope clearly has some clout over Python now, but the language will remain independent. In fact, the benefits are two-way because Zope also has some goodies for Python, like the Z Object Database (for a tutorial, see A. M. Kucheling's "ZODB/ZEO Programming Guide").
Since last year, some six to eight hundred bugs have been reported and squashed. Python 2.1 has some nifty new features: nested scopes, a warnings framework, pydoc and weak references, to name a few. Guido is especially excited about pydoc, a program that finds a module and prints its docstrings and structure in a format similar to a man page. "You can even run it as a server and point a web browser at it", he explained.
Guide also announced the Python Software Foundation (PSF) (www.python.org/psf), a non-profit organization to hold Python's copyright, which is described as follows: "Modeled after the successful Apache Software Foundation, the PSF's mandate is to provide educational, legal and financial resources to the Python community. Responsible for holding Python's intellectual property, the PSF will also act as an educational resource, maintain the Python web site and foster Python user groups."
Last year, Guido used the code name "Python 3000" to refer to a mythical future version that would be perfect but not necessarily backward-compatible. Since then, the Python team has realized that a quantum leap is not necessary. All desired changes can be implemented gradually using the new warnings framework and the __future__ module to give users a transition period (see "What's New in Python 2.1" for more information).
He then introduced Python Enhancement Proposals (PEPs) (see python.sourceforge.net/peps). A PEP document proposes one change to the language or to the standard library, and it serves as the definitive summary of the arguments for and against it. This replaces the disorganized free-for-all under which past language enhancements were debated (and then lost in the forest of newsgroup archives). It works great, Guido says, when somebody gets a bright idea that was rejected six months ago, "except when it's your bright idea that's being rejected".
He was so excited about Pippy, a port of Python 1.5.2+ for the Palm Pilot, that he got a PalmOS 3.5 upgrade just because it was "so cool". He thinks Python is a perfect match for small end embedded platforms. To facilitate this, the Python team must be extra diligent to avoid code bloat so that Python can run in 8MB of RAM with space for application code and data.
Paul Everett, head of Digital Creations (DC), opened the Zope track of presentations at the conference. "Zope is finally maturing", he said. 2001 will be the Year of the Zope Books; five will be published by the end of the year. DC has three goals for Zope this year: increase its public profile, ease the learning curve and increase its use in enterprise situations.
"The Python language combines power and simplicity", he said. "Zope has at least half of that." Zope's main users are developers now, so DC is moving Zope to a more component-centric and developer-friendly architecture. Three major concepts that looked great at the beginning but have since shown their limitations (acquisition, inheritance and DTML) are being supplanted by other concepts that contain fewer "gotchas".
2001 is also the year of Zope Alternatives. My favorite discovery was Webware. Chuck Esterbrook developed this modular web application server out of frustration with the monolithic nature of Zope (see Chuck's presentation for an overview). The main component is WebKit, which allows Python packages to be servlets. Here's a minimum servlet:
from WebKit.Page import Page class index(Page): def title(self): # This will go into the HTML <TITLE> tag. return "Important Message" def writeBody(self): self.writeln(" This web site is not here yet.")
You can call this "index.py" and invoke it in the browser as index.py, index or even as the directory. The file must contain a class with the same name as the file, and this class is normally a subclass of Page. CGI parameters and cookies are as simple as:
req = self.request() fname = req.field('fname') bgcolor = req.cookie('bgcolor', '#FFFFFF') # With default.
You even get a session object for free:
sess = self.session() name = sess.value('name') sess.setValue('x', 5)
The application caches servlet instances for later reuse. It interacts with Apache or AOLserver via a CGI interface or a web server module (e.g., mod_python). Two other plug-ins deserve mention. Python Server Pages is for those who prefer embedding Python commands in HTML files à la ASP or PHP. MiddleKit is an object-oriented intermediary for database access.
I wish I had space to discuss some of the other talks. Eric Raymond presented CML2, his Linux kernel configuration system. Others talked about internationalizing Mailman using GNU gettext, weak references, writing Microsoft .NET programs in Python, etc. One notable module mentioned is pyperl), which allows your script to call Perl functions.
In the hallway were vendor exhibits, including ActiveState's Python Cookbook (a free interactive FAQ), and the Toilet Paper display.
Toilet Paper is an automated water closet. No, there wasn't a loo in the hallway, just a diagram of the privy. A 486 computer running Slackware sits alongside the porcelain bowl. It detects visitors outside via a motion detector and has sensors for toilet seat position, light switch position, etc., and then plays appropriate music for each state. It fetches selected web pages, extracts the headlines and displays them on an LCD screen. Toilet also has an external web interface to request songs, report on its usage history (scary) and send messages to the LCD screen.
Bruce Eckel is the person who invented the "Python Fits Your Brain" slogan as well as last year's "Life is Better Without Braces". He's also a well-known C++ and Java design consultant. In his closing keynote, Bruce presented the top ten reasons why he loves Python:(See the Powerpoint slides from Bruce's presentation.)
10. Reduced clutter.
8. It doesn't value performance over my productivity.
7. It doesn't treat me like I'm stupid. Java insists operator overloading is bad because you can make ugly code with it. Bruce observes, "And we all know there's no ugly Java code out there."
6. I don't have to wait forever for a full implementation of the language.
5. It doesn't make assumptions about how we discover errors.
4. Marketing people are not involved in it (yet).
3. I don't have to type so much. But what I do type is the right typing.
2. My guesses are usually right.
1. Python helps me focus on my concepts rather than on fighting with the language.
His idea for the next Python slogan? "No warranty, not fit for any particular purpose." We'll see about that next year.
Conference proceedings and slides have been posted to the Python9 web site.
Mike Orr writes web applications at SSC, edits Linux Gazette and does other sysadmin stuff. He doesn't usually write articles, but he makes an exception for Python because it's so cool.