Python Forum
the quest for a mutable string (more) - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: the quest for a mutable string (more) (/thread-41897.html)



the quest for a mutable string (more) - Skaperen - Apr-04-2024

i've been thinking about making Python easier to handle mutable strings in the type of bytearray. this should be possible in the definition of the language an its tools. there are many places where only strs can be provided. just make it so that bytes and bytearray are allowed as alternate types, converted when needed, usually when provided. a simple case would be the print() function. the arguments and sep= and end= would be extended to allow data given to it to be in bytes or bytearray. everything else would be handled like this. where it now requires str only, it can accept any of str, bytes,,or bytearray.