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

Class madtuple

Lib/test/test_descr.py:2971–2979  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2969 self.assertEqual(a / 1, base)
2970
2971 class madtuple(tuple):
2972 _rev = None
2973 def rev(self):
2974 if self._rev is not None:
2975 return self._rev
2976 L = list(self)
2977 L.reverse()
2978 self._rev = self.__class__(L)
2979 return self._rev
2980 a = madtuple((1,2,3,4,5,6,7,8,9,0))
2981 self.assertEqual(a, (1,2,3,4,5,6,7,8,9,0))
2982 self.assertEqual(a.rev(), madtuple((0,9,8,7,6,5,4,3,2,1)))

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…