replacing __dict__ with an OrderedDict

Steven D'Aprano steve+comp.lang.python at
Fri Jan 6 19:45:31 EST 2012

On Sat, 07 Jan 2012 04:01:44 +1100, Lie Ryan wrote:

> On 01/07/2012 12:36 AM, Ulrich Eckhardt wrote:
>> True, perhaps, but doing it this way would be more fun and easier
>> reusable in other cases where the default order is not desirable. I can
>> also go and name the test functions test_000 to test_009 to get results
>> quickly, if that was the only goal.
> Fun and easier, perhaps. Except that it solves the wrong problem.

Fun and easier, and a terrible thing to do. Contrast:

"test_binsearch_tuple is failing. What does that mean?"
"Oh, that tests that binsearch works on a tuple. You need to look at the 
BinSearch.search_tuple method and see what it's doing."


"test_047 is failing. What does that mean?"
"How the hell should I know?"

Debugging is hard enough without obfuscating the test names. You wouldn't 
write a function called "func_009", why write one called "test_009"?


More information about the Python-list mailing list