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

Method rev

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

Source from the content-addressed store, hash-verified

2977 class madunicode(str):
2978 _rev = None
2979 def rev(self):
2980 if self._rev is not None:
2981 return self._rev
2982 L = list(self)
2983 L.reverse()
2984 self._rev = self.__class__("".join(L))
2985 return self._rev
2986 u = madunicode("ABCDEF")
2987 self.assertEqual(u, "ABCDEF")
2988 self.assertEqual(u.rev(), madunicode("FEDCBA"))

Callers

nothing calls this directly

Calls 4

listClass · 0.85
reverseMethod · 0.45
__class__Method · 0.45
joinMethod · 0.45

Tested by

no test coverage detected