> Aha, that's useful to know. So it's a no-no to subclass *any* builtin?
I don't think it's a no-no, I just think it comes with a few problems that are
solved if you subclass the classes that are *meant* to be subclassed, like
UserDict, UserList, or UserString.
> I checked collections.UserDict
Hi Albert-Jan,
As far as I know, the recommended object to subclass when subclassing a `dict`
is `UserDict`. In Python 3, it's in `collections.UserDict` and in Python 2 is
in `UserDict.UserDict`.
Here's an basic example of how it would work:
try:
from collections import UserDict
except Impo