Skip to content

py/objdict.c: Implement dictionary union (PEP 584). - #8523

Closed
RayaneCTX wants to merge 1 commit into
micropython:masterfrom
ECE595:dictionary-union-feature
Closed

py/objdict.c: Implement dictionary union (PEP 584).#8523
RayaneCTX wants to merge 1 commit into
micropython:masterfrom
ECE595:dictionary-union-feature

Conversation

@RayaneCTX

@RayaneCTX RayaneCTX commented Apr 11, 2022

Copy link
Copy Markdown
Contributor

Implements dictionary union according to PEP 584 specifications, minus the fact that dictionary entries are not guaranteed to be in insertion order. However, that will no longer be the case once the underlying map implementation is changed to preserve insertion order (see #6173).

A new test is added under tests/basics for this functionality.

This was worked on with the assistance of Fangrui Qin qinf@purdue.edu

Signed-off-by: Rayane Chatrieux rayane.chatrieux@gmail.com

@RayaneCTX
RayaneCTX force-pushed the dictionary-union-feature branch from 7e67f6b to d13afdc Compare April 12, 2022 00:14
Implements dictionary union according to PEP 584's specifications,
minus the fact that dictionary entries are not guaranteed to be in
insertion order. However, that will no longer be the case once the
underlying map implementation is changed to preserve insertion order
(PR#6173).

tests/basics/dict_union.py: Add a new set of tests.

With the assistance of Fangrui Qin <qinf@purdue.edu>

Signed-off-by: Rayane Chatrieux <rayane.chatrieux@gmail.com>
@RayaneCTX
RayaneCTX force-pushed the dictionary-union-feature branch from d13afdc to 3a0ac5e Compare April 12, 2022 15:10
@RayaneCTX RayaneCTX changed the title py/objdict.c: Implements dictionary union (PEP 584). py/objdict.c: Implement dictionary union (PEP 584). Apr 12, 2022
@dpgeorge dpgeorge added the py-core Relates to py/ directory in source label Apr 29, 2022
@dpgeorge

Copy link
Copy Markdown
Member

Thanks for the contribution. I have rebased and merged this in f3e4c50 with a code size optimisation (combined both switch cases) and guarded this feature by MICROPY_CPYTHON_COMPAT (it will be available on most ports/boards).

@dpgeorge dpgeorge closed this Nov 25, 2022
tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

py-core Relates to py/ directory in source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants