loopy icon indicating copy to clipboard operation
loopy copied to clipboard

LazilyUnpickling{Dict,List}: add __repr__

Open matthiasdiener opened this issue 2 years ago • 1 comments

from loopy.tools import LazilyUnpicklingList, LazilyUnpicklingDict, _PickledObject
l = LazilyUnpicklingList([1, 2, 3, 4])
print(l)
d = LazilyUnpicklingDict({'a':1, 'b':2})
print(d)
p = _PickledObject(7)
print(p)

before:

<loopy.tools.LazilyUnpicklingList object at 0x101810810>
<loopy.tools.LazilyUnpicklingDict object at 0x104b2ccd0>
<loopy.tools._PickledObject object at 0x10103a450>

after:

LazilyUnpicklingList([1, 2, 3, 4])
LazilyUnpicklingDict({'a': 1, 'b': 2})
_PickledObject(7)

(If you want, I could add __str__ methods that don't include the class names.)

matthiasdiener avatar Nov 20 '23 17:11 matthiasdiener

This is ready for review.

matthiasdiener avatar Dec 04 '23 18:12 matthiasdiener