MCPcopy Index your code
hub / github.com/RustPython/RustPython / rev

Method rev

Lib/test/test_descr.py:2880–2886  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2878 class madtuple(tuple):
2879 _rev = None
2880 def rev(self):
2881 if self._rev is not None:
2882 return self._rev
2883 L = list(self)
2884 L.reverse()
2885 self._rev = self.__class__(L)
2886 return self._rev
2887 a = madtuple((1,2,3,4,5,6,7,8,9,0))
2888 self.assertEqual(a, (1,2,3,4,5,6,7,8,9,0))
2889 self.assertEqual(a.rev(), madtuple((0,9,8,7,6,5,4,3,2,1)))

Callers 15

setup_dynamic_stdlibFunction · 0.45
reverse_stringFunction · 0.45
split_idents_on_dotFunction · 0.45
highestMethod · 0.45
dump_tracebackFunction · 0.45
dump_all_threadsFunction · 0.45
getitem_by_sliceMethod · 0.45
setitem_by_sliceMethod · 0.45
emit_next_tokenFunction · 0.45
find_fstring_middle_typeFunction · 0.45

Calls 3

listClass · 0.85
reverseMethod · 0.45
__class__Method · 0.45

Tested by

no test coverage detected