Message131415
Éric Araujo <report@bugs.python.org> writes:
> - reductor = getattr(x, "__reduce__", None)
> - if reductor:
> - rv = reductor()
> - else:
> - raise Error("un(shallow)copyable object of type %s" % cls)
> + raise Error("un(shallow)copyable object of type %s" % cls)
>
> Why change this?
Because it is impossible for this code to be called in Python 3 -
"object" now itself supplies __reduce_ex__, so the fall-through to look
for plain "__reduce__" does not occur here. This default __reduce_ex__
then calls any user-defined __reduce__, if present.
>> self.assertTrue(issubclass(copy.Error, Exception))
> You could change that to assertIsInstance.
I will do so on Monday to make a final form of the patch, along with any
other suggestions that come in!
>> -def _test():
> I assume that all cases that were tested in that function are covered
> by unit tests.
Yes! |
|
Date |
User |
Action |
Args |
2011-03-19 13:40:08 | brandon-rhodes | set | recipients:
+ brandon-rhodes, ncoghlan, belopolsky, pitrou, benjamin.peterson, eric.araujo, daniel.urban |
2011-03-19 13:40:07 | brandon-rhodes | link | issue11572 messages |
2011-03-19 13:40:07 | brandon-rhodes | create | |
|