Talks at PyCon that Teach How to Be Better Programmers

Robert Brewer fumanchu at
Tue Oct 24 18:26:47 CEST 2006

Jeff Rush wrote:
> ...we need more talks that actually teach you how
> to be better programmers...What the Heck Does
> "Pythonic Programming Style" Mean Anyway?

I'm finishing an outline for a talk which will overlap this one a bit,
but under the topic "What makes a great API?" that will be directed more
at library authors than users:

I. Zero learning required

"""Civilization advances by extending the number of important operations
which we can perform without thinking about them."""
    -- Alfred North Whitehead, Introduction to Mathematics (1911)

"""To be Pythonic is to avoid surprising experienced Python programmers
with unfamiliar ways to accomplish a task."""
    -- Martijn Faassen

1. Use native types, functions and idioms.
    a. Bare functions are better than class collections
    b. getters and setters considered harmful
2. Inventing new types: use Python idioms instead of inventing your own
    a. conform to Python API's
    b. subclass builtins rather than delegating
    c. judicious use of descriptors
3. DSLs suck
4. "Imagine your dream code and figure out how to make it happen"

But when you need to learn/remember something, the API must be...

II. Inspectable

1. If help() is to be helpful, you must reduce [len(dir(obj)) for obj in
2. Dynamic languages naturally more lang-maven oriented?

III. Programmable

1. Config and other "declarative" modes: No "XML sit-ups"

IV. Readable = Simple

1. Parameterization and customization

Robert Brewer
System Architect
Amor Ministries
fumanchu at

More information about the Python-list mailing list