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

Class StrWithStr

Lib/test/test_str.py:2420–2426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2418 def test_conversion(self):
2419 # Make sure __str__() works properly
2420 class StrWithStr(str):
2421 def __new__(cls, value):
2422 self = str.__new__(cls, "")
2423 self.value = value
2424 return self
2425 def __str__(self):
2426 return self.value
2427
2428 self.assertTypedEqual(str(WithStr('abc')), 'abc')
2429 self.assertTypedEqual(str(WithStr(StrSubclass('abc'))), StrSubclass('abc'))

Callers 1

test_conversionMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_conversionMethod · 0.68