Home | History | Annotate | Download | only in collections

Lines Matching refs:elem

460     for elem in iterable:
461 elem] = mapping_get(elem, 0) + 1
486 >>> for elem in 'shazam': # update counts from an iterable
487 ... c[elem] += 1 # by adding 1 to each element's count
619 for elem, count in iterable.items():
620 self[elem] = count + self_get(elem, 0)
654 for elem, count in iterable.items():
655 self[elem] = self_get(elem, 0) - count
657 for elem in iterable:
658 self[elem] = self_get(elem, 0) - 1
669 def __delitem__(self, elem):
671 if elem in self:
672 super().__delitem__(elem)
703 for elem, count in self.items():
704 newcount = count + other[elem]
706 result[elem] = newcount
707 for elem, count in other.items():
708 if elem not in self and count > 0:
709 result[elem] = count
722 for elem, count in self.items():
723 newcount = count - other[elem]
725 result[elem] = newcount
726 for elem, count in other.items():
727 if elem not in self and count < 0:
728 result[elem] = 0 - count
741 for elem, count in self.items():
742 other_count = other[elem]
745 result[elem] = newcount
746 for elem, count in other.items():
747 if elem not in self and count > 0:
748 result[elem] = count
761 for elem, count in self.items():
762 other_count = other[elem]
765 result[elem] = newcount
771 for elem, count in self.items():
773 result[elem] = count
782 for elem, count in self.items():
784 result[elem] = 0 - count
789 nonpositive = [elem for elem, count in self.items() if not count > 0]
790 for elem in nonpositive:
791 del self[elem]
803 for elem, count in other.items():
804 self[elem] += count
816 for elem, count in other.items():
817 self[elem] -= count
829 for elem, other_count in other.items():
830 count = self[elem]
832 self[elem] = other_count
844 for elem, count in self.items():
845 other_count = other[elem]
847 self[elem] = other_count