overriding __getitem__ for a subclass of dict

Scott David Daniels Scott.Daniels at Acm.Org
Tue Nov 17 10:11:01 EST 2009


Steve Howell wrote:
...
> Eventually, I realized that it was easier to just monkeypatch Django
> while I was in test mode to get a more direct hook into the behavior I
> was trying to monitor, and then I didn't need to bother with
> overriding __getitem__ or creating complicated wrapper objects....

Since nobody else has mentioned it, I'd point you at Mock objects:
     http://python-mock.sourceforge.net/
for another way to skin the cat that it sounds like has been
biting you.  They are surprisingly useful for exploratory
and regression testing.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list