« MIT Press classics series | Main | Dave Pawson! »

Python antpattern: UserDict as object scaffolding

In UserDict as object scaffolding I mentioned that:

"I have a habit, when working in Python, of starting classes by extending UserDict, usually because I dont have a strong idea of where I'm going just yet."

I've had enough feedback to suggest this is either pointless or a bad idea. So I'll be unlearning it.

April 9, 2005 08:17 PM


Ken MacLeod
(April 10, 2005 12:21 AM #)

I concur. I somehow missed the first article or would have mentioned it also.

In fact, I go the other direction. When a data object has fields but doesn't yet have methods, I'll still use a generic object so I can use attribute syntax.

I'm very happy about property access in newer Pythons, so I can add accessors without losing attribute syntax.

Post a comment

(you may use HTML tags for style)

Remember Me?

Trackback Pings

TrackBack URL for this entry: