[issue12654] sum() works with bytes objects

2011-07-29 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue12654] sum() works with bytes objects

2011-07-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7368d0e9b33e by Benjamin Peterson in branch 'default': bytes should be verboten in sum() (fixes #12654) http://hg.python.org/cpython/rev/7368d0e9b33e -- nosy: +python-dev ___ Python tracker

[issue12654] sum() works with bytes objects

2011-07-29 Thread Antoine Pitrou
New submission from Antoine Pitrou : ... while it apparently shouldn't: >>> sum([b'', b''], b'') b'' >>> sum([b'', b''], bytearray()) Traceback (most recent call last): File "", line 1, in TypeError: sum() can't sum bytes [use b''.join(seq) instead] In 2.7, the situation is the reverse: >>