Python antpattern: UserDict as object scaffolding
April 09, 2005 |
co.mments
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
Comments
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
Trackback Pings
TrackBack URL for this entry:
http://www.dehora.net/mt/mt-tb.cgi/1536