MCPcopy Index your code
hub / github.com/python/cpython / __repr__

Method __repr__

Lib/collections/__init__.py:747–756  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

745 super().__delitem__(elem)
746
747 def __repr__(self):
748 if not self:
749 return f'{self.__class__.__name__}()'
750 try:
751 # dict() preserves the ordering returned by most_common()
752 d = dict(self.most_common())
753 except TypeError:
754 # handle case where values are not orderable
755 d = dict(self)
756 return f'{self.__class__.__name__}({d!r})'
757
758 # Multiset-style mathematical operations discussed in:
759 # Knuth TAOCP Volume II section 4.6.3 exercise 19

Callers

nothing calls this directly

Calls 1

most_commonMethod · 0.95

Tested by

no test coverage detected