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 problem for Bazel though is that Java's LinkedHashMap only allows O(1) popping of oldest entries. So we'd need an alternative implementation which would need to be benchmarked (no memory/cpu regressions since dict is extremely widely used).
dict.popitem
now removes the first element. specThere are three reasons to change it
Consistency with
list
list.pop
removes the last element.Consistency with Python
Performance
If
dict
is implemented using linked list, it is fine. But linked-list is suboptimal for both time and space.If the
dict
is implemented using an array (like starlark-rust does):popitem
isO(N)
.Changing it to pop the last element makes this operation efficient.
Migration
This is backwards incompatible change.
The text was updated successfully, but these errors were encountered: