Message2915
1) I've just looked through the code for the copy module, and finally understand what's going on with __copy__. __copy__ is called by copy whenever it finds a type it doesn't have a predefined mapping for, so PyDeque and PyDefaultDict will both need it since they have specific copy behavior they want to use. We haven't needed it anywhere else in Jython because copy handles builtin types explicitly. So leaving __copy__ on PyDeque and PyDefaultDict is fine and good.
2) From 1, we already support __copy__, it just wasn't used in the core Java code up until now.
3) Looking at the test code in test_defaultdict, passing in the object as a value in a key error seems reasonable.
4) The only seeing one place, in PyDeque.deque_init, so that wasn't too bad. I just noticed that one and assumed you'd only fixed it in PyDefaultDict.
The only remaining problem is that your equality changes are causing test_richcmp to fail. DictTests.test_dicts fails for me because equality testing now uses methods other than __eq__ and __ne__ for testing. If you can fix that, I'll apply the patch. |
|
Date |
User |
Action |
Args |
2008-02-20 17:18:51 | admin | link | issue1804242 messages |
2008-02-20 17:18:51 | admin | create | |
|