On 5 January 2011 15:57, Nick Coghlan firstname.lastname@example.org wrote:
On Wed, Jan 5, 2011 at 11:42 PM, Michael Foord email@example.com wrote:
So should I do this in unittest for Python 2.7 / 3.2?
The problem this *would* solve is that pickled unittest objects from 2.7
3.2 can't be unpickled on earlier versions of Python.
I don't know how *real* a problem it is or whether it is worth losing / faking the __module__ information on these classes to solve it. Sure it's
problem that is likely to bite *someone* at some point, but not very many people. If someone is using __module__ information to find source code
anything else) for a class then changing __module__ will break that, so
not convinced it's a worthwhile tradeoff.
The two examples I looked at (functools and datetime) favoured hiding the implementation details at the cost of causing introspection problems. Despite my comments in the opening post of the thread, I think that is the better trade-off to make.
Both of those are because of underlying C implementations where introspection problems would be the default anyway, which isn't quite the same for situation for unittest.
-- Nick Coghlan | firstname.lastname@example.org | Brisbane, Australia _______________________________________________ Python-ideas mailing list Pythonemail@example.com http://mail.python.org/mailman/listinfo/python-ideas