Entry
I'd like to create a subclass of list that loads its contents from a file when you instantiate it. What do I subclass to do this?
Sep 29th, 2002 06:58
Joel Burton, unknown unknown, Remco Gerlich
You can't directly subclass types, like lists and integers. This is
commonly viewed as a flaw in Python, maybe this will be changed once.
However, you can subclass UserList.UserList, a Python wrapper around a
list (see Lib/UserList.py for its source).
Update for Python 2.2: with type/class integration, you can now
subclass 'list' directly.