Open Helveg opened 3 years ago
Implemented in #1711
As label_dict is essentially frozen, we cannot implement
These remain open/untested, but I am less sure we need all of them
[]
?@Helveg does this fulfill your needs?
get
accepts a default argument that simplifies control flow:val = labels.get("key", "(nil)")
try:
val = labels["key"]
except KeyError:
val = "(nil)"
setdefault
reversed
dict(label_dict)
work? With an incomplete dict
API it can't be duck typed everywhere so the conversion might occur.Why not implement __delitem__
? Imagine wanting to strip a certain set of keys from a factory label dict. I don't see a specific use case for pop(item)
since it is unordered, but del
certainly.
dict
interface:fromkeys
items
keys
values
pop
popitem
get
setdefault
update
clear
__reversed__
__contains__
arbor.label_dict
function does not accept the same arguments as thedict
constructor (e.g. doesn't know what to do with azip
object, it does not even accept anotherlabel_dict
as arg)label_dict
to adict
yields an empty dictionary, or an error: