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

Method rev

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

Source from the content-addressed store, hash-verified

3070 class madunicode(str):
3071 _rev = None
3072 def rev(self):
3073 if self._rev is not None:
3074 return self._rev
3075 L = list(self)
3076 L.reverse()
3077 self._rev = self.__class__("".join(L))
3078 return self._rev
3079 u = madunicode("ABCDEF")
3080 self.assertEqual(u, "ABCDEF")
3081 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