Whole file

timofurrer/colorful

The author described this change as Fix correctnes of __str__ to return always a str. It counts as a record because the check below fails on the code as it stood at 662c044fa and passes on 676070ef0, with nothing else changed between the two runs.

Fix saved2022-12-04
Sharing licenceMIT · LICENSE
Change size+2 2

What the code was meant to do, written into the code itself as a save note

Fix correctnes of __str__ to return always a str

The change

227227 Represents a colored string
228228 """
229229 def __init__(self, orig_string, styled_string, colorful_ctx):
230- self.orig_string = orig_string
231- self.styled_string = styled_string
230+ self.orig_string = str(orig_string)
231+ self.styled_string = str(styled_string)
232232 self.colorful_ctx = colorful_ctx
233233
234234 def __str__(self):

The check that tells the two apart

failpass·tests/test_core.py::test_underling_type_should_be_stored_as_str

Check file tests/test_core.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it662c044fa24f0a1e9b5fbdb98924ddc5a08b4c53
Broken version dated2022-12-04
Modulecolorful.core
Units changedColorfulString
Fingerprintf1727be39e5ae2ac
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in timofurrer/colorful