kennethreitz / crayons

Text UI colors for Python.
https://pypi.python.org/pypi/crayons
MIT License
423 stars 30 forks source link

str.join is broken #7

Closed Ohjeah closed 5 years ago

Ohjeah commented 7 years ago
import crayons

s1 = "this"
s2 = crayons.red("breaks")
s1.join([s2])

>>> TypeError: sequence item 0: expected str instance, ColoredString found
caizixian commented 7 years ago

You need to view a ColoredString object as str by calling str()

s1.join([str(x) for x in [s2]])

ParthS007 commented 5 years ago

Closing due to inactivity :+1: