This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients mark.dickinson, pitrou, rhettinger
Date 2011-07-29.12:45:31
SpamBayes Score 4.9259197e-06
Marked as misclassified No
Message-id <1311943531.95.0.378108563398.issue12654@psf.upfronthosting.co.za>
In-reply-to
Content
... while it apparently shouldn't:

>>> sum([b'', b''], b'')
b''
>>> sum([b'', b''], bytearray())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: sum() can't sum bytes [use b''.join(seq) instead]


In 2.7, the situation is the reverse:

>>> sum([b'', b''], b'')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: sum() can't sum strings [use ''.join(seq) instead]
>>> sum([b'', b''], bytearray())
bytearray(b'')
History
Date User Action Args
2011-07-29 12:45:32pitrousetrecipients: + pitrou, rhettinger, mark.dickinson
2011-07-29 12:45:31pitrousetmessageid: <1311943531.95.0.378108563398.issue12654@psf.upfronthosting.co.za>
2011-07-29 12:45:31pitroulinkissue12654 messages
2011-07-29 12:45:31pitroucreate