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.
Created on 2011年07月29日 12:45 by pitrou, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg141363 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2011年07月29日 12:45 | |
... 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'') |
|||
| msg141408 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年07月29日 19:24 | |
New changeset 7368d0e9b33e by Benjamin Peterson in branch 'default': bytes should be verboten in sum() (fixes #12654) http://hg.python.org/cpython/rev/7368d0e9b33e |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:20 | admin | set | github: 56863 |
| 2011年07月29日 21:08:35 | benjamin.peterson | set | status: open -> closed resolution: fixed |
| 2011年07月29日 19:24:42 | python-dev | set | nosy:
+ python-dev messages: + msg141408 |
| 2011年07月29日 12:45:31 | pitrou | create | |