class_docstr: A persistent bag/multiset type.
  
  Requires elements to be hashable, and allows duplicates, but has no
  ordering. Bags are hashable.
  
  Do not instantiate directly, instead use the factory functions :py:func:`b`
  or :py:func:`pbag` to create an instance.
  
  Some examples:
  
  >>> s = pbag([1, 2, 3, 1])
  >>> s2 = s.add(4)
  >>> s3 = s2.remove(1)
  >>> s
  pbag([1, 1, 2, 3])
  >>> s2
  pbag([1, 1, 2, 3, 4])
  >>> s3
  pbag([1, 2, 3, 4])
class_docstr_tok: ["A","persistent","bag\/multiset","type",".","Requires","elements","to","be","hashable",",","and","allows","duplicates",",","but","has","no","ordering",".","Bags","are","hashable",".","Do","not","instantiate","directly",",","instead","use","the","factory","functions",":","py",":","func",":","`","b","`","or",":","py",":","func",":","`","pbag","`","to","create","an","instance",".","Some","examples",":",">",">",">","s","=","pbag","(","[","1",",","2",",","3",",","1","]",")",">",">",">","s2","=","s.add","(","4",")",">",">",">","s3","=","s2.remove","(","1",")",">",">",">","s","pbag","(","[","1",",","1",",","2",",","3","]",")",">",">",">","s2","pbag","(","[","1",",","1",",","2",",","3",",","4","]",")",">",">",">","s3","pbag","(","[","1",",","2",",","3",",","4","]",")"]
docstr: Return the length including duplicates.
  
  >>> len(pbag([1, 1, 2]))
  3
docstr_tok: ["Return","the","length","including","duplicates",".",">",">",">","len","(","pbag","(","[","1",",","1",",","2","]",")",")","3"]
code: def __len__(self):
      """
      Return the length including duplicates.
  
      >>> len(pbag([1, 1, 2]))
      3
      """
      return sum(self._counts.itervalues())
  
imports: from ._compat import Container, Iterable, Sized, Hashable
  from functools import reduce
  from pyrsistent._pmap import pmap
label_desc: Use image node_id 6 for calling the PBag obj's underlying member method code with example usage: obj.__len__() and returns: sum