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

Lines Matching refs:iterable

192     def fromkeys(cls, iterable, value=None):
198 for key in iterable:
247 def _make(cls, iterable, new=tuple.__new__, len=len):
248 'Make a new {typename} object from a sequence or iterable'
249 result = new(cls, iterable)
399 >>> for elem in 'shazam': # update counts from an iterable
432 def __init__(self, iterable=None, **kwds):
434 from an input iterable
438 >>> c = Counter('gallahad') # a new counter from an iterable
444 self.update(iterable, **kwds)
489 def fromkeys(cls, iterable, v=None):
493 'Counter.fromkeys() is undefined. Use Counter(iterable) instead.')
495 def update(self, iterable=None, **kwds):
498 Source can be an iterable, a dictionary, or another Counter instance.
501 >>> c.update('witch') # add elements from another iterable
515 if iterable is not None:
516 if isinstance(iterable, Mapping):
519 for elem, count in iterable.iteritems():
522 super(Counter, self).update(iterable) # fast path when counter is empty
525 for elem in iterable:
530 def subtract(self, iterable=None, **kwds):
535 Source can be an iterable, a dictionary, or another Counter instance.
538 >>> c.subtract('witch') # subtract elements from another iterable
546 if iterable is not None:
548 if isinstance(iterable, Mapping):
549 for elem, count in iterable.items():
552 for elem in iterable: