Home | History | Annotate | Download | only in python2.7

Lines Matching refs:elem

399     >>> for elem in 'shazam':           # update counts from an iterable
400 ... c[elem] += 1 # by adding 1 to each element's count
519 for elem, count in iterable.iteritems():
520 self[elem] = self_get(elem, 0) + count
525 for elem in iterable:
526 self[elem] = self_get(elem, 0) + 1
549 for elem, count in iterable.items():
550 self[elem] = self_get(elem, 0) - count
552 for elem in iterable:
553 self[elem] = self_get(elem, 0) - 1
564 def __delitem__(self, elem):
566 if elem in self:
567 super(Counter, self).__delitem__(elem)
594 for elem, count in self.items():
595 newcount = count + other[elem]
597 result[elem] = newcount
598 for elem, count in other.items():
599 if elem not in self and count > 0:
600 result[elem] = count
613 for elem, count in self.items():
614 newcount = count - other[elem]
616 result[elem] = newcount
617 for elem, count in other.items():
618 if elem not in self and count < 0:
619 result[elem] = 0 - count
632 for elem, count in self.items():
633 other_count = other[elem]
636 result[elem] = newcount
637 for elem, count in other.items():
638 if elem not in self and count > 0:
639 result[elem] = count
652 for elem, count in self.items():
653 other_count = other[elem]
656 result[elem] = newcount