Skip to content

Commit

Permalink
feat: mk_item2kv_for.kv_pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
thorwhalen committed Jan 4, 2024
1 parent b5c388d commit 386c6bd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dol/appendable.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ class mk_item2kv_for:
(('go', 'let'), {'I': 'it'})
"""

@staticmethod
def kv_pairs():
"""
Essentially, the identity. Is used when the items are already (key, val) pairs.
"""
def item2kv(item):
return item

return item2kv

@staticmethod
def item_to_key(item2key):
"""Make item2kv from a item2key function (the value will be the item itself).
Expand Down

0 comments on commit 386c6bd

Please sign in to comment.