Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Slicing is not consistent between a regular string and a Colorclass string #23

Open
kizbitz opened this issue Nov 5, 2017 · 0 comments

Comments

@kizbitz
Copy link

kizbitz commented Nov 5, 2017

Python 2.7.13 (default, Jul 24 2017, 20:13:18)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from colorclass import Color

>>> s = 'This is a test string ...'
>>> c = Color('{autogreen}This is a test string ...{/autogreen}')

>>> print s
This is a test string ...
>>> print c
This is a test string ...
>>> print s[:14]
This is a test
>>> print c[:14]
This is a

# work around
>>> print c.value_colors.replace(c.value_no_colors, c.value_no_colors[:14])
This is a test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant