Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug description:
b=bytearray(b"abc")b.extend('def')
Traceback (most recent call last): File "<stdin>", line 1, in <module>TypeError: 'str' object cannot be interpreted as an integer```… except thatbytes.extend doesn't even accept integers as arguments; the error refers to the first element of the string, which happens also to be a string in Python. Meh.
Could CPython please complain about requiring the string to be encoded instead?
CPython versions tested on:
main branch
Operating systems tested on:
Linux