Open
Description
I see this warning in the standard library:
/tmp/pygrate2/Lib/codecs.py:506: Py3xWarning: The first string is 'str' while the second is 'unicode': mixed bytes, str and unicode operands cannot be used in string concatenation in Python 3.x: convert the operand(s) so that they are the same type.
self.charbuffer += newchars
Since Python3 doesn't have the unicode
type per se, I'm wondering if this warning is quite right? As I understand the situation (and my memory is a bit fuzzy...):
- Python2 has the types
str
andunicode
but not a typebytes
. Thebytes()
function returnsstrs
. - Python3 has the types
bytes
andstr
but notunicode
.
If I've got that (roughly) correct, I wonder whether the warning at the top of this issue is correct and/or as accurate as it could be? I think that str + unicode
in Python2 will always map to str + str
in Python3? Or are there certain types of strings/unicode strings in Python2 that will map to bytes in Python3?
Metadata
Metadata
Assignees
Labels
No labels