Arfrever Frehtes Taifersar Arahesis added the comment:

You rather meant [2:-1] instead of [1:-1], but if initial "b'" and final "'" 
are not needed in result string, then maybe just call .decode() on an instance 
of bytes.

>>> str(b"xxx")
"b'xxx'"
>>> repr(b"xxx")
"b'xxx'"
>>> repr(b"xxx")[1:-1]
"'xxx"
>>> repr(b"xxx")[2:-1]
'xxx'
>>> b"xxx".decode()
'xxx'

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20363>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to