24 Aug
2012
24 Aug
'12
1:40 p.m.
On Fri, 24 Aug 2012 14:33:48 -0400
Daniel Holth
String only would be perfect. I only single out bytes because they are more like strings than any other type.
You can use concatenation instead of (or in addition to) formatting:
"" + "foo" 'foo' "" + b"foo" Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: Can't convert 'bytes' object to str implicitly "" + 42 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: Can't convert 'int' object to str implicitly
Regards Antoine. -- Software development and contracting: http://pro.pitrou.net