(self, items, replace_at_most_one,
                          replacements, leftovers)
Subclassed from omdict._bin_update_items() to make update() and
        updateall() process lists of values as multiple values.

        <replacements> and <leftovers> are modified directly, ala pass by
        reference.
Subclassed from omdict._bin_update_items() to make update() and
        updateall() process lists of values as multiple values.
Subclassed from omdict . _bin_update_items () to make update () and updateall () process lists of values as multiple values .
def _bin_update_items(self, items, replace_at_most_one,
                          replacements, leftovers):
        """
        Subclassed from omdict._bin_update_items() to make update() and
        updateall() process lists of values as multiple values.

        <replacements> and <leftovers> are modified directly, ala pass by
        reference.
        """
        for key, values in items:
            # <values> is not a list or an empty list.
            like_list_not_str = is_iterable_but_not_string(values)
            if not like_list_not_str or (like_list_not_str and not values):
                values = [values]

            for value in values:
                # If the value is [], remove any existing leftovers with
                # key <key> and set the list of values itself to [],
                # which in turn will later delete <key> when [] is
                # passed to omdict.setlist() in
                # omdict._update_updateall().
                if value == []:
                    replacements[key] = []
                    leftovers[:] = [lst for lst in leftovers if key != lst[0]]
                # If there are existing items with key <key> that have
                # yet to be marked for replacement, mark that item's
                # value to be replaced by <value> by appending it to
                # <replacements>.
                elif (key in self and
                      replacements.get(key, _absent) in [[], _absent]):
                    replacements[key] = [value]
                elif (key in self and not replace_at_most_one and
                      len(replacements[key]) < len(self.values(key))):
                    replacements[key].append(value)
                elif replace_at_most_one:
                    replacements[key] = [value]
                else:
                    leftovers.append((key, value))
def _bin_update_items ( self , items , replace_at_most_one , replacements , leftovers ) : for key , values in items : # <values> is not a list or an empty list. like_list_not_str = is_iterable_but_not_string ( values ) if not like_list_not_str or ( like_list_not_str and not values ) : values = [ values ] for value in values : # If the value is [], remove any existing leftovers with # key <key> and set the list of values itself to [], # which in turn will later delete <key> when [] is # passed to omdict.setlist() in # omdict._update_updateall(). if value == [ ] : replacements [ key ] = [ ] leftovers [ : ] = [ lst for lst in leftovers if key != lst [ 0 ] ] # If there are existing items with key <key> that have # yet to be marked for replacement, mark that item's # value to be replaced by <value> by appending it to # <replacements>. elif ( key in self and replacements . get ( key , _absent ) in [ [ ] , _absent ] ) : replacements [ key ] = [ value ] elif ( key in self and not replace_at_most_one and len ( replacements [ key ] ) < len ( self . values ( key ) ) ) : replacements [ key ] . append ( value ) elif replace_at_most_one : replacements [ key ] = [ value ] else : leftovers . append ( ( key , value ) )