Leonard's PyCon Adventure

In March 2003 I went to PyCon to give a talk on configuration frameworks. I was seen again. This is my story.

I've got some pictures, if you're into that sort of thing.

Please insert day 1 of 5

Sumana and I arrived in Dulles at 7:30 in the morning, checked into our hotel, and then went off to PyCon. Don't take the door-to-door shuttle bus from Dulles! It costs $25 and it takes forever because the other passengers have the unmitigated audacity to want to go to other parts of DC than the part you want to go to. I think one of our passengers was dropped off in an entirely different state, in Virginia or Michigan or something. Take the $8 shuttle to the Metro instead. This would have worked well for us because we were staying right next to a Metro station and we didn't have lots of baggage. We did this on the way back and it was a big success.

The Hundred-Year Language

Arriving at PyCon, Sumana volunteered to checked people in, and I was checked in, issued my PyCon tote bag and ActiveState temporary tattoo. I wedged myself into the main ballroom and tried to hear Paul Graham blather on about "The Hundred-Year Language". By the time I arrived, the talk was in Q&A. I tend not to remember Q&A sessions, so I'm afraid I can offer very little detail in regards to Paul's talk. The paper has some general thought-provoking material in it, though.

There was then a coffee break. A lot of very good junk food (like cookies) was provided at PyCon, and I ate way too much of it. All is a haze at this point due to the junk food. I think this may have been the point at which I struck up an acquaintance with Rowland Smith, one of the authors of PythonCard.

Generalized Deferred Execution in Python

I remember catching the end of this talk by Glyph Lefkowitz. It was the first of several talks I was to attend which took as their baseline the Twisted network library. This talk was basically about the Deferred class, a clever callback handler that lets you get rid of blocking while waiting for a response from a server.

Python In Education

The first presentation I actually saw all of was Wesley Chun's talk on Python in education. He presented some statistics on what sort of person takes an adult education Python course and why. Most such people are apparently C or C++ programmers.

Then it was time for lunch, which consisted of hideous wraps. Even as I ate the wrap, I rued having to eat the wrap. For all I know the wrap came pre-rued.

After noon it started getting incredibly hot. At intervals during the afternoon I nodded off during talks. It was aggravating, but the talks were good.

Building a Better Bug Detector

The first talk I attended in the afternoon was Niel Norwitz talking about PyChecker, which is an awesome piece of code. It analyzes Python bytecode and looks for bugs and inconsistent usage. It finds unused variables, inconsistent return values, and the like. It provides some of the error checking you'd get in a strongly typed language.

Niel mentioned some future plans for PyChecker: he'd like to get it to find circular imports, and to analyze an abstract syntax tree instead of bytecode. He wants to get it included with Python and maybe triggered by a command-line switch. He also wants there to be a configuration interface to the >50 and growing options that control which tests PyChecker runs, though I don't know if he wanted that before I talked to him about it.

Some other good future additions to PyChecker: using statistics about the source code to find deviations from your regular programming style that might signify bugs: for instance, if nine times out of ten you do something one way, and the tenth time you do it a completely different way, PyChecker can tell you that you might want to look at that tenth case. It should also be possible to use code comments as directives to PyChecker, telling it to ignore something it would otherwise flag as problematic.

Also in this talk I found out about Bicycle Repair Man, a code browser that helps you refactor code.

Unit Testing in Python

Since I never write unit tests, I figured I should go to a talk where the speaker would likely harrangue me about the need to write unit tests, and Tom Bryan's talk on unit testing did not disappoint. The talk managed to quell my main fear about unit testing: you don't have to write dummy versions of all your interfaces just so the unit tests of the code that uses the interfaces will be ideologically pure and "unit". You can run the unit tests for low-level interfaces first and then use those interfaces. The slides sort of tsk-tsk at you if you do that, but I don't see the percentage in dummy interfaces.

Tom has an excellent set of slides with good examples of unit tests. Highly recommended.

There's a clever Python module called doctest which lets you embed a Python shell session in docstrings, and then tries to duplicate those shell sessions. It doesn't really fit my programming style, though, since I rarely use the Python shell session when developing Web applications. I think PyUnit is more my speed. Is there something like HttpUnit for Python? The slides ask that question, and so do I.

Teaching Programming with Python and PyGame

There was then another coffee break and more junk food. I went to this talk by Dr. Vern Ceder and Nathan Yergler on using Python as a pedagogical language. I was hoping it would talk about some details of PyGame, of which I am woefully ignorant, but instead it was a talk about how kids respond to Python and how to teach a computer science class using it. Which makes sense, because the talk was not "I Will Teach You Programming With Python And PyGame In One Hour Or Your Money Back". The important thing when teaching programming to kids who are not already programmers is to get their interest as early as possible, and a combination of games (== fun) and Python (== easy to use) is good for that.

Twisted Reality: A Flexible Framework for Virtual Worlds

I caught the end of this talk by Allen Short, which had to do with a Python adventure game engine. By the time I came in, the other attendees were familiar enough with the design to second-guess Allen's decisions in his demo code. They'd bring up some obscure case and he'd either make up some way of handling the obscure case or demonstrate that his next slide handled it. I'm not a big fan of such behavior, but the game engine looks nice, and gave me some ideas; I've been looking for a Python alternative to Inform.

Python in a Rapid Development Environment

A nice case study from Christopher Blunck. He was on a team doing an embedded software application for a demanding client. They used a stripped-down version of Python and patched things on the demo machine on the fly so that remote clients could see their requested changes immediately. I felt a strange kinship with his tale.

After the talks died down on the 26th, I went over to a nearby TGI Friday's with some fellow attendees. Everyone had beers except someone else and myself, who had milkshakes. I left earlier than others so that I could meet up with Sumana for our traditional Wednesday night watching of "The West Wing".

Please insert day 2 of 5

State of the Python Union

This was Guido's talk. No record of this talk exists except for his PowerPoint presentation, which I can't read. So I'll just share what I wrote in my notes, which is some interesting code metrics that Guido passed down to us:

Guido ran these metrics on old and new versions of Python and found that (amazingly!) all of them had increased over time.

Guido also mentioned that many of the recent labor-saving additions to Python have not yet been reflected in the modules. He recommended that those wanting to help engage in holistic refactoring, picking a module and modernizing it, rather than attempting to make one particular change to every module.

Application Configuration Using ZConfig

The time for my talk was fast approaching, but first we all had to sit through this interesting talk by Chris McDonough. He described an alternative to ConfigParser which enforces the semantics of option settings and instantiates application-specific Python objects based on the option settings.

Beyond The Config File: User-Friendly Configuration For Web Apps

Woo hoo! This was my talk. I did my comic routine (sorry, comic routine slides removed from published slideshow for copyright reasons, and also so I can use the same routine for years on end without anyone ever being the wiser) which got some laughs. I talked about configuration frameworks, which make it easier to configure and develop an application with a lot of user settings.

I was afraid my yammering would be too abstract and the angry mob would crave examples, so I'd painstakingly set up all of my examples and a NewsBruiser installation on my laptop to show them, to show them all. But they seemed happy with my talk as it was, and no examples were demanded or shown. I think that Chris' talk softened them up a bit, because a lot of the groundwork of what I was talking about was covered in his talk.

At lunch there were more wraps. I fled the wraps (as did many others, as evidenced by the heaps of untouched wraps on the tables for the rest of the day). There was a food court downstairs from the conference room, and I got some orange chicken which was pretty bad, but at least it wasn't a wrap.

Traits: Strongly Typed Attributes for Python

Sort of a mini-theme of PyCon was automatically generating user interfaces for the an object's properties. My talk covered this, the ZConfig file was related to it, this talk covered it, and the faceted classification talk talked about something similar. The focus of this talk, delivered by David C. Morrill, dealt more with the desktop application side of things.

A trait is basically a property of an object which has additional semantics. There was the concept of a "Trait editor" which popped up whenever to let the user change the value for a trait in an appropriate way; this editor could be a field, a window, or a completely different application. I don't know how much of the multi-trait edit interface (multiple trait editors laid out in one panel) was autogenerated and how much was hard-coded, but it was really impressive. Traits can also respond to events generated by other traits (I think this is how he enforces interdependency between traits).

Implementing SSH in Twisted

I came in on the end of this talk by Paul Swartz, so I didn't get much out of it. There were a series of these talks which dealt with how easy it was to implement various things in Twisted (the Twisted Reality talk was another of these). I gotta admit, it looks pretty easy compared to socket programming.

This was the last talk I saw on the 27th. That evening Sumana and I went out with a friend of hers and walked along the Mall.

Please insert day 3 of 5

Flightdeck-UI -- a Cockpit on your Desktop

George Belotsky talked a bit about the possible uses in computer interfaces of analog-style displays: dials and gauges and the like. He demonstrated an example application using FlightDeck-UI, a set of dial and gauge UI widgets. Mentioned was an interesting-sounding book by Jef Raskin of Macintosh fame, The Humane Interface.

I don't think deliberately recreating the limitations of gear-driven physical widgets necessarily makes an interface more humane, but a gauge or a dial is definitely better for glancing at, when you need to keep an eye on what is changing and in which direction rather than keeping track of exact values.

The other big idea George (somewhat implicitly) presented was the flattening widget of hierarchies: if you look at this FlightDeck-UI screenshot you'll see what I mean. I like a little hierarchy in my widgets, so to me this looks like another case of taking the limitations of physical UIs to be an advantage. Sometimes it is easier to have everything laid out, though, to check consistency or a range across items.

One other interesting idea in the presentation was the GhostNeedleDriver. A gauge in FlightDeck-UI can have "ghosts" of its previous values remain like afterimages on the face of the gauge, to provide some history for the value.

The Web Framework Shootout

Ian Bicking gave us an overview of the thousands of Python Web frameworks out there. I think this might be one of those areas where people say "oh, we need to standardize" but never do. Or maybe they do, I don't know. I personally don't like web frameworks because I like my applications to be self-contained. I'm just babbling here. Interesting frameworks mentioned in the talk were:

Infinite Filing Cabinet

Another mini-theme of PyCon was object persistence: transparently storing objects and maybe also distributing them across a network. The Infinite Filing Cabinet stores Python objects in a database and lets you query the database. There's also caching and an event system that can notify you when an object is created or a result set changes.

PyMite: A Flyweight Python Interpreter for 8-bit Architectures

I caught the beginning of this talk by Dean Hall. He's implemented a stripped-down version of Python for 8-bit systems, because he was sick of the other choices being BASIC, IC (Interactive C), and OOPIC (guess). PyMite runs each Python bytecode with a function call, something I always associated with programming exercises (possibly because the only virtual machines I've ever written were for programming exercises). Dean was talking about the tradeoffs he'd made and how he stored objects in memory, when I had to leave to attend another lightning presentation:

Intrinsics: Changing the Types of Literals

This one brought the house down. Jean-Paul Calderone demonstrated to us that he is evil. He's written a module which lets you switch out the class implementing a base Python type so that it points to another class of your choosing (it does this by changing the pointer to the type class). In his example, he replaces 'int' so that integer literals are represented as Roman numerals. I recommend you read the presentation; all the code is in there. Guido said, "I don't think our insurance covers this."

Python Regrets

Guido took the stage once more to rehash a talk he'd given at OSCON the previous year. He talked about the various features of Python he now regretted having added, like lambda ("I never liked lambda") and reduce. Another funny moment: Guido regrets callable(), which is difficult to implement. "Just call it already," said Guido.

Grateful to have an oracle of Python feature quality evaluation, people asked Guido a lot of other questions about whether such and such a feature was a regret. Then they started talking about the damn ternary operator. I was sitting right in the front and didn't want to draw attention to myself by leaving, so unfortunately I missed Francesco Garelli's talk on Satine, an XML-to-Python-object converter. (Another talk I missed that I'd been really interested in was the talk given on Prevayler, an object persistence layer, continuing the persistence layer mini-theme).

More damn wraps for lunch! By this time I had discovered a place across the street, called Lindy's. I went over there and got a hamburger. I was hoping other attendees would be jealous of my hamburger and demand to know where I got it, but in general they seemed okay with having wraps. Had they been brainwashed? Before I could ponder this question I was swept away to another talk.

Case Study: A Faceted Classification Solution for a Reusable Digital Asset Repository

This is the other talk that mentioned autogenerated user interfaces. Michael Bernstein wrote a Zope application that allows a user to define metadata fields for artifacts (like "season" and "product" for a database that contains images) at runtime. The metadata fields are then displayed as part of the user interface. There's also an autogenerated search interface that lets you filter on the user-defined categorizations.

For some reason all of the autogenerated user interface talks except for mine used a "color" example to demonstrate selection from multiple values, and the selectable colors were red, green, and blue. I probably didn't do this because that mental space was already occupied for me by IWO's HTMLColorOption, a text option which takes a hex color or an HTML color constant.

Escape from PyCon

At this point I was going stir crazy, so I escaped PyCon and spent the rest of the day on the National Mall. I walked from the hotel to the Lincoln Memorial, from there to the Korean and Vietnam memorials, then up past the Washington Monument to the museums.

I was disappointed by the cultural anthropology wing of the National Museum of Natural History, possibly because I just recently visited the British Museum. They had a nice conceit of "what would your life have been like x thousand years ago [in Europe or the Mediterranean]?", though. The mineral collection was greatly superior, and included a lot of meteorites, including a chunk from the famous Meteor Crater Arizona meteorite. Some good fossils, including early fossils from the Greyson shale in Montana, which I'd never heard of. There was also some hilarious signage due to the narrative form they took for the history of life, eg. "Opportunity Knocks For Oligocene Mammals", which makes it sound like the mammals had gotten together and decided that the time had finally come to get bigger and take over the world.

Then I went to the National Air and Space Museum, which I've visited every time I've been to DC. This time I was more interested in the airplanes than on previous visits; I like the mechanical aesthetic of the 1960s, and it's not just the spacecraft that had it.

The Air and Space gift shop had some really tacky stuff in it: there was a plush Air Force One that made jet noises when you squeezed it. There was also a space-themed chess set in which the pawns were astronauts and the other pieces were planets. Like I said, tacky.

When the museum closed, I took the Metro back to the hotel, stopping for dinner at a Pakistani(?) place in Georgetown called Mehran. They had a poster up listing the 99 names of Allah, but I'm pretty sure there were actually 101 names on the poster (the names were in an 8*13 grid, and the main name of Allah took up four grid squares instead of one, and 8*13-3=101). Were there two squares missing from the bottom corners of the poster, or are there two extra names of Allah? I don't know. At Mehran I got a kebab, which was pretty good.

Please insert day 4 of 5

Sumana and I spent most of this day with my uncle Robert and cousin Brian. He came into DC to pick us up, and we ate at a steakhouse called the District Chophouse. They had a good salad with blue cheese, good mashed potatoes... everything was really good, and filling (and expensive). We were intending to visit the National Cryptography Museum, but due to a masterpiece of bad planning it was closed that day. So we went to Fredericksburg, where Robert lives, and visited a demonstration at the Fredericksburg apothecary (live leeches!). While walking around we were ran into some of the Fredericksburg reenactment people packing up from their day of reenacting colonial Fredericksburg, who looked like the same sort of people who attend Renaissance festivals. Sure enough, when they saw us passing by, they gave us brochures for the Virginia Renaissance Faire.

We also visited a Civil War graveyard; there was no one else around, possibly because it was technically past closing time, possibly because there was heavy wind and a thunderstorm was about to break.

Just before heading back to DC, we visited Carl's, apparently a Fredericksburg tradition. It's a frozen custard stand which will put all sorts of viscous liquids on your frozen custard, like maple walnut syrup, until you don't know what's what. Very tasty, fast service, and they use a cool looking old-fashioned ice cream machine to make the custard. Robert said a lot of local politicians come to Carl's as an attempt to create rapport with the citizenry.

Please insert day 5 of 5

We ate a stylish buffet brunch at the Smithsonian commissary. Pretty ritzy. The walls were decorated with the family crests of various upper-crust scientists. Did you know that Isaac Newton's family crest was a crossbones? Then we saw the Gerhard Richter show at the Heary gallery, which is a well-designed toroidal shape, so once you're done with the exhibit you're also where you started.

I was excited about the Old Masters at the National Gallery, but Sumana was tired, so she rested as I oohed and aahed at the Rembrandts. I could walk around the National Gallery all day, but I didn't want to tire Sumana out, and it was almost time to make our way back to Dulles.

Before we left, we managed to squeeze in a brief visit to the Museum of American History. We saw some old printing equipment, including a printing press used by Ben Franklin as an apprentice. We also looked in at the MusAmHit ice cream parlor, which is a big disappointment: the ice cream is generic, the method by which you pay for the ice cream makes no sense, and the whole thing looks like a nonfunctional Cajun restaurant in New Orleans Square at Disneyland. However, there was an old automat (!) installed in one wall, which made up for it.

On the way to the airport there was snow on the ground. Sumana was excited about this, whereas I was apprehensive about the status of our flight. We took off on time, though, and made it safely back to Oakland.

Postscript: The Ternary Operator Is Wacky

The surest laugh line at PyCon was to mention the proposed ternary operator. This happened at least three times that I heard, and two of the times I remember the specific line:

"Ternary is pure evil in the hands of high school kids."

-- from "Teaching Programming with Python and PyGame".

"Unless you want to hear about every one of the competitors in the ternary operator contest..."

-- Guido, during the State of the Python Union (during "Python Regrets" we did in fact hear about every one of the competitors in the ternary operator contest).

This document (source) is part of Crummy, the webspace of Leonard Richardson (contact information). It was last modified on Tuesday, April 13 2004, 04:17:26 Nowhere Standard Time and last built on Friday, April 25 2014, 01:00:05 Nowhere Standard Time.

Crummy is © 1996-2014 Leonard Richardson. Unless otherwise noted, all text licensed under a Creative Commons License.

Document tree:

Site Search: