This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients Arfrever, brett.cannon, eli.bendersky, eric.snow, ezio.melotti, pitrou
Date 2013-01-28.20:50:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1359406211.85.0.445413297744.issue17037@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2013-01-28 20:50:11eric.snowsetrecipients: + eric.snow, brett.cannon, pitrou, ezio.melotti, Arfrever, eli.bendersky
2013-01-28 20:50:11eric.snowsetmessageid: <1359406211.85.0.445413297744.issue17037@psf.upfronthosting.co.za>
2013-01-28 20:50:11eric.snowlinkissue17037 messages
2013-01-28 20:50:11eric.snowcreate