mirror of https://github.com/explosion/spaCy.git
Use dict.copy().items() instead of list(.items()) (#9868)
This commit is contained in:
parent
018827e9fd
commit
94fbd88521
|
@ -604,7 +604,7 @@ cdef class ArcEager(TransitionSystem):
|
|||
actions[SHIFT][''] += 1
|
||||
if min_freq is not None:
|
||||
for action, label_freqs in actions.items():
|
||||
for label, freq in list(label_freqs.items()):
|
||||
for label, freq in label_freqs.copy().items():
|
||||
if freq < min_freq:
|
||||
label_freqs.pop(label)
|
||||
# Ensure these actions are present
|
||||
|
|
|
@ -274,7 +274,7 @@ cdef class Vectors:
|
|||
self.data = resized_array
|
||||
self._sync_unset()
|
||||
removed_items = []
|
||||
for key, row in list(self.key2row.items()):
|
||||
for key, row in self.key2row.copy().items():
|
||||
if row >= shape[0]:
|
||||
self.key2row.pop(key)
|
||||
removed_items.append((key, row))
|
||||
|
|
Loading…
Reference in New Issue