Eric Snow added the comment:

FWIW, here's a little more explanation on my original thoughts, none of which 
I'm married to.

Most of the magic in my patch came messing with the globals (swap out the 
module and module attrs; add in the two new classes; ditch the original class). 
 That was a consequence of my remaining objectives.

I was also following the lead of decorators by having the the boilerplate 
before the test case definition rather than split up before and after.

Finally, I was trying to do it in a way that existing test cases, like 
TestOrderedDict, would need as little changes as possible.

This leads to one bit of boilerplate that I'm not a fan of: the whole 
self.<module> thing.  For TestOrderedDict, it meant changing all uses of an 
OrderedDict global to self.collections.OrderedDict.  In fact, that was 
essentially the biggest motivation for the "magic" in the decorator.  However, 
I can live with the boilerplate--I'll just deal with the search-and-replace 
(not the end of the world).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17037>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to