Thursday, June 4, 2009

PyCon 2009 Notes - March 28th

Day Two of the "core" of PyCon 2009...

Morning Lightning Talks

You’ll find the video at

Jesse Noller’s “Python License V3” is pretty funny ( contains only that talk). contains all the Saturday morning lightning talks.

Katie Cunningham talks on Python at NASA at 19:15.

PlayerPiano ( pretend typing of doctests for demos at 35:15.

James Bennett had a good presentation on DVCSs at 40:10:

PyMite - a subset of Python for microcontrollers (at 45:15)

  • will run in as little as 64 KB flash and 4 KB RAM
  • easy porting: one file with six functions
  • interactive interface
  • easy to write native functions: embed C code in docstrings
  • to try it out:
    • svn co
    • cd trunk; make ipm
  • TODO - would be interesting to port it to Nios II

web2py (at 49:50)

  • admin interface not just for database, but for design & debug

Keynote: Guido van Rossum

You’ll find the video at

The R-word

  • “I’m not retiring, but I’m tiring.”
  • doesn’t enjoy traveling like he used to
  • “I’m sort of thinking over the next five or ten years to gradually fade away.”
  • Hopes in 5 years that the BDFL is not actually leading the community anymore, more of a figurehead.
  • “Don’t look to me for guidance for everything.”

Mentioned a new PEP that he supports on “yield from” which is useful for building “coroutine libraries” [I think]

MAY be a dependency & packaging API in 2.7 & 3.1—he mentioned this problem several times, it’s certainly on his mind as a big unsolved problem

“Remember, once you put an API in the core, it may not be dead but it evolves at a glacial pace.” “Third-party packages can evolve much faster.”

“The standard library may be just the right size.”

  • Can’t shrink it without killing apps.
  • Don’t want to add things until they’re stable. “Biologists call things that are stable ‘dead’.”

Answering a question about code blocks: “Let’s stop tinkering with the languages and [focus on] solv[ing] the problems around the language.”

  • FOR FUTURE INVESTIGATION: Guido said you could put a decorator around a nested function that “says execute here” (@apply?) - would this be the equivalent of Ruby code blocks? What are the advantages of Ruby code blocks? How are they used? Would this apply to nested, apply-decorated functions like this?

Jacob Kaplan-Moss - The State of Django

You’ll find the slides (in PDF format) and video at I didn’t take any notes. (And the slides aren’t meant to be read by themselves.)

Joe Gregorio - The (lack of) design patterns in Python

You’ll find the slides (in PDF format) at, but there’s no video yet. (I’ll update this when it appears.)

BTW, Joe Gregorio’s PyCon 2009 blog post is at You’ll find links to his “An Introduction to Google App Engine” tutorial materials there (as well as mention of this talk).

This was one of my favorite talks from PyCon 2009.

Mythology - languages are all turing complete

Python isn’t Java without the compile

“Yes, design patterns are good, but they’re also a sign of weakness in a language.”

The patterns are built in [to Python].

  • “No one talks about the ‘structured programming’ pattern, or the ‘object-oriented’ pattern, or the ‘function’ pattern anymore.”

“When most of your code does nothing in a pompous way that is a sure sign that you are heading in the wrong direction. Here’s a translation into Python.”
- Peter Otten

Wikipedia Strategy Pattern page - “invisible in languages with first-class functions”.

no need for iterator pattern in Python

also talked about Abstract Factory pattern, and others

TODO - I need to think about his using a decorator for the observer pattern. (Slides 27 through 29.)


  1. look to features before patterns
  2. reduce patterns -> shorter code
  3. needed patterns -> language feature

Concurrency Patterns listed on Wikipedia:

  • Thread pool, etc.
  • “do these point to language features we should be talking about adding?”

See the Google Video: “Advanced Topics in Programming Languages: Concurrency and Message Passing in Newsqueak” by Rob Pike

Jack Diederich - Class Decorators: Radically Simple

You find the slides (in PDF & PPT formats) and video at

This was also one of my favorite talks from PyCon. I recommend you watch the video.

Practical definitions of a decorator:

  • takes one argument
  • returns something useful
import cron
class SalesReport(Report):
def run(self):
# do stuff
“Can do everything in class decorators that you can do in metaclasses” [I may have paraphrased.]
  • class decorators are explicit
  • class decorators are easily stackable (unlike metaclasses—while possible, it’s difficult to remember how)
  • nice alternative to mixins

Popular patterns:

  • register - like cron scheduler above
  • augment - like mixins
  • fixup
  • verify

very simple (and slick) registration class decorator - see slide 25

Best Practices

  • return the original class
  • don't assume you are the only decorator
  • maybe you want a metaclass [he still uses them sometimes]
  • don't add slots

Ed Leafe - Dabo: Rich Client Web Applications in 100% Python

Slides (in ODP format) and video at

advantages of web application:

  • zero deployment
  • cross platform
  • centralized control (of databases)


  • limited UI

Manifest Class

  • client and server diff each other, ala rsync

Dabo Springboard is a launch app (to allow you to run apps without have to install, so you get the same advantage as a browser-based app)

Bob Ippolito - Drop ACID and think about data

Video at I found the slides at (linked to from his "PyCon 2009, Drop ACID and think about data") blog post.

This was a "firehose-style" presentation, so I recommend you first have a look at the slides, then try the video if interested.


  • Atomicity - all or nothing
  • Consistency - no explosions
  • Isolation - no fights (when used concurrently)
  • Durability - no lying

networks make ACID difficult in a distributed environment (which is necessary for reliability and scalability)


  • basically available
  • soft state
  • eventually consistent

Then reviews the pros & cons of:

  • BigTable
  • Dynamo
  • Cassandra
  • Tokyo Cabinet & Tokyo Tyrant
  • Redis
  • CouchDB
  • MongoDB
  • Column Databases
  • MonetDB
  • LucidDB
  • Vertica
    • this is the one his company (MochiMedia) decided to pay for; “it works”

“Bloom Filters are Neat”

  • probabilistic data structure
  • false positives at a known error
  • constant space
  • uses:
    • approximate counting of a large set (eg. unique IPs from logs)
    • knowing that data is definitely NOT stored somewhere (eg. remote chache)

Ian Bicking - Topics of Interest

Video, slides, and IRC logs available at

I went to this talk because I had heard Ian Bicking is a great speaker and is “not to be missed”. I’m afraid I wish I had missed it. Ian kept a live IRC display on the screen as he spoke. While it was good for some laughs, it was a distraction to both the speaker and the audience.

TODO - he mentioned a lot of names of what I presume are projects he’s started (he assumed—incorrectly in my case—that we all knew what they are), I should learn about them:

  • Paste
  • Deliverance
  • WebOb
  • PoachEggs
  • pip

Alex Martelli - Abstraction as Leverage

I chose the Ian Bicking talk over this one. The video and slides (PDF) are at

TODO: I intend to review them. I’ve never regretted attending an Alex Martelli lecture.

Lennart Regebro - Python 2.6 and 3.0 compatibility

I chose the Ian Bicking talk over this one also. But this looks interesting: “This talks takes a look at the various options of migrating to Python 3, and takes up examples of some tricks you can do to make you code run unmodified under both 2.6 and 3.0.” The video and slides (PDF) are at

Evening Lightning Talks

You’ll find the video at

snakebite - (right at the start of the video)

  • “Snakebite is a network that strives to provide developers of open source projects complete and unrestricted access to as many different platforms, operating systems, architectures, compilers, devices, databases, tools and applications that they may need in order to optimally develop their software.”

reading and writing Excel files from Python (5:40) (8:35)

  • for filtering RSS feeds
  • open source

funny numbers rant (15:55)

Martin v. Löwis talks about porting Django and pyscopg to Python 3.0 (32:30)

Leonard Reder from JPL spoke about “Mars Science Laboratory - Flight Software Automatic Code Generation Tools” (37:35)

1 comment:

Priya angel said...

Thank you.. This is very helpful. .Python Online Training