Brett Cannon: Abstract Base Classes PEP accepted

May 25th, 2007 § 0 comments

Brett Can­non: Abstract Base Classes PEP accepted

ABCs are one of the cooler things (in my opin­ion) that are com­ing in Python 3k — how­ever, I know that there’s many peo­ple who have prob­lems with the pro­posed imple­men­ta­tion. (Brett points out PEP 3133 which is the Roles proposal).

Right now — I per­son­ally like the ABC approach — it’s flex­i­ble (min­i­mal­ist) and will not get in your way if you don’t want/need it (one of Pythons biggest draws for me). Obvi­ously we’ll see how it stacks up in imple­men­ta­tion — it could sim­ply be that I don’t know/understand enough about the alter­na­tives to “know any better”.

I’m about to seri­ously start dig­ging my teeth into Java pro­gram­ming (while I con­tinue on my Python path, nooch) and one of the key things the Java guys and I talk about with some reg­u­lar­ity is the notion of sta­tic inter­faces and types.

There is some­thing nice about sta­tic types and sta­tic inter­faces — you always know what you’re get­ting and expect­ing. The prob­lem with that of course, is that the guy who wrote the object to begin with has to account for every use of the object.

Of course: that’s a plus in a large code base with a large team. I instinc­tively pull back from the con­cept of those hand­cuffs — how do you know what I need to do with that object? Why not let me change it/alter it dynamically?

I’m sure we’re going to see more about ABCs in the com­ing months. Mean­while — I’ll con­tinue to learn. I like doing that.

Ran­dom thought of the day: How early can you start teach­ing a kid Python?

(Via Brett Can­non.)

What's this?

You are currently reading Brett Cannon: Abstract Base Classes PEP accepted at jessenoller.com.

meta