This is my code:
a = html.unescape("home - study")
b = "test"
s = (a, b)
home - study
By default, printing sequences like
lists and others uses
object.__str__. That delegates control to the respective
repr for the object (
tuple.__repr__ here) which then proceeds to call the
repr of its respective members.
repr for a string with escape codes (such as
\xa0) will, in effect, not escape them:
To further verify, try
print(s). By providing the
str object in position
0 directly, python will invoke its
__str__ and escape the hex correctly.