micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

WIP: Update deque

Open mattytrentini opened this issue 2 years ago • 1 comments

MicroPython's built-in deque lacks many features but is implemented in C so is very lean and fast. The micropython-lib version is implemented in Python and has more features - but should have even more. This is a start toward achieving feature-parity with CPython's deque.

mattytrentini avatar Aug 21 '21 12:08 mattytrentini

This could possibly be merged as-is (I had to extend deque to supporting porting the progress library to MicroPython) but I'm going to try and add all the other features of deque as well as use as much as possible of the CPython test cases.

mattytrentini avatar Aug 21 '21 12:08 mattytrentini

chiming in that this helped make some of my cpython code be micropython-compatible.

BrianPugh avatar May 10 '23 03:05 BrianPugh

Note that the built-in deque has had some substantial improvements, see:

https://github.com/micropython/micropython/commit/7dff38fdc190d7b731fad8319d2ae8aa13fde18a

There is little reason to use this Python version now - which is great!

mattytrentini avatar Mar 18 '24 04:03 mattytrentini

Now that the core collections.deque class is more fully implemented, I think we should just remove the deque implementation here. That will prevent any confusion, everyone will just use the built-in version.

dpgeorge avatar Mar 18 '24 11:03 dpgeorge

I agree; the differences are minimal, so I'll close this. Fantastic to see the built-in deque improved!

mattytrentini avatar Mar 18 '24 22:03 mattytrentini