Call signal for str.join:
S.join(sequence) -> string
Return a string which is the concatenation of the strings in the
sequence. The separator between elements is S.
Note what sequenceis expected as a string sequence. Many objects have methods __str__, but not all of them (for example, Stringy) are instances str.
The fix, of course, is simple:
'-'.join(('carnitas',str(lunch)))
source
share