You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The statement delete!(d,k), where d is a Dict or Set and k is a key, does not throw a key error even when k is missing from d. (In this case, it is a no-op.) On the other hand, SortedSet and SortedDict, throw a key error in this circumstance. Because these packages have been around for awhile, possibly someone is counting on this incompatible behavior, so I don't know whether to modify these containers to bring them in line with Dict. One subtlety: Dict and Set are not necessarily typed, whereas SortedDict and SortedSet are almost always typed. So one corner case is delete!(s,k) where s has keytype K, and k is not convertible to K.
The text was updated successfully, but these errors were encountered:
One subtlety: Dict and Set are not necessarily typed, whereas SortedDict and SortedSet are almost always typed. So one corner case is delete!(s,k) where s has keytype K, and k is not convertible to K.
I would agree that this "strongly typed" key functions is a feature of SortedDict/SortedSet, and so I think we can keep this behavior while still claiming to implement Base.AbstractDict / AbstractSet. It seems reasonable to me to allow delete! nonexistent keys only when they're a subtype of K. 👍
The statement
delete!(d,k)
, whered
is aDict
orSet
andk
is a key, does not throw a key error even whenk
is missing fromd
. (In this case, it is a no-op.) On the other hand, SortedSet and SortedDict, throw a key error in this circumstance. Because these packages have been around for awhile, possibly someone is counting on this incompatible behavior, so I don't know whether to modify these containers to bring them in line with Dict. One subtlety:Dict
andSet
are not necessarily typed, whereas SortedDict and SortedSet are almost always typed. So one corner case isdelete!(s,k)
wheres
has keytypeK
, andk
is not convertible toK
.The text was updated successfully, but these errors were encountered: