Caught after updating test_deque.py. In RustPython, pickling a deque subclass ignores its __dict__:
>>>>> import pickle
>>>>> from collections import deque
>>>>> class Deque(deque): pass
>>>>> d = Deque()
>>>>> d.x = "value"
>>>>> e = pickle.loads(pickle.dumps(pickle.HIGHEST_PROTOCOL))
>>>>> e.__dict__
{}
While in Python, __dict__ is correctly returned as {'x': 'value'}.
This doesn't appear to be the case with some other collections like list and dict so those could probably serve as an inspiration for what might be missing in deque.
For testing purposes, see test_copy_pickle in Lib/test/test_deque.py.
Caught after updating
test_deque.py. In RustPython, pickling a deque subclass ignores its__dict__:While in Python,
__dict__is correctly returned as{'x': 'value'}.This doesn't appear to be the case with some other collections like
listanddictso those could probably serve as an inspiration for what might be missing indeque.For testing purposes, see
test_copy_pickleinLib/test/test_deque.py.