Stephen
Stephen
MModular
Created by Stephen on 1/7/2025 in #questions
Why is `"\0A"` the default `end` value for `print`?
I saw this in some hover text in vscode and wondered if that was correct. Sure enough the docs confirm this. I sort of understand the null termination, but why the 'A' after the null byte? In the future, can we expect print to handle null bytes? e.g., in python, I can do
In [1]: print('text\0A more text')
textA more text

In [2]: print(repr('text\0A more text'))
'text\x00A more text'
In [1]: print('text\0A more text')
textA more text

In [2]: print(repr('text\0A more text'))
'text\x00A more text'
6 replies