I'm not sure what I'm doing wrong here:
>>> class Stringy(object):
... def __str__(self):
... return "taco"
... def __repr__(self):
... return "taco"
...
>>> lunch = Stringy()
>>> lunch
taco
>>> str(lunch)
'taco'
>>> '-'.join(('carnitas',lunch))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: sequence item 1: expected string, Stringy found
Given my inclusion of the __str__()
method in the Stringy object, shouldn't join()
see lunch as a string?