Skip to content

[feature] .items() for Maps #25

@RiedleroD

Description

@RiedleroD

a method to get (key, value) pairs from a Map, e.g.:

input: {1: 2, 2: 4, 3: 6}

output: [[1, 2], [2, 4], [3, 6]]

this would be useful for iterating over maps, e.g. when correlating with another map:

# both of these have album ID as their key
albumart = {…}
albumtitles = {…}
for id, title in albumtitles.items():
    art = albumart[id]
    pass # do stuff with title and art

some notes:

  • the pairs should be final and immutable.
  • I'm assuming there's no unpacking support for for loops yet? would also be very beneficial.

Metadata

Metadata

Assignees

Labels

analyzerThis issue is related to the analyzercompilerThis has to do with the bytecode compilerenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions