pycon logo

PyCon 2011 Atlanta

March 9th–17th

Log in or Sign Up

API Design: Lessons Learned

log in to bookmark this presentaton

E
I
Experienced / Talk
March 12th 2:55 p.m. – 3:40 p.m.
Share the lessons learned from a decade of core Python development, what worked and what didn't. Look at the development process and thinking behind some of Python's successful APIs and ones that leave something to be desired. Learn general principles for designing a good API for public consumption.

Abstract

Hear the story and principles behind the design of Python's "in" operator, the development of deques, and the evolution of the set API.

Examine the principles and story behind the development of the named tuple API. Learn about unforeseen use cases and a bug that made it to production.

Discuss the decimal module's API challenge -- adhering to a published standard. Talk about the Queue module's framework style and how the API was refactored.

Discuss what we've learned about naming functions and methods. Look at the i-naming convention in itertools, camelcase oddities, the proposed Italian name for enumerate, and vaguely named methods like assertItemsEqual.

Learn about Guido's ideas on when to add flags to method signatures. Recap his thoughts on the problems with the percent formatting operator. Then hear Raymond's advice on packaging, hierarchies, and nested name spaces.

See how to use documentation to mitigate API problems using examples from regular expressions, decimal, tokenize, sorting.