> It's basically "Schroedinger's strings", you don't need to know if some data is valid string data until you actually need it as a string, and often this isn't needed at all
Then you can pass around an untyped value, which is the default in all versions of Python. With type annotations, one can spell this typing.Any.
When you finally do need your value to be a string, you need to decide whether it’s a runtime error when it needs to be a string or whether it’s a runtime error way up the call stack. Especially if databases are involved (or network calls, etc), this decision matters.
> e.g. the standard string type should always only be UTF-8
It almost kind of sounds like you’re arguing in favor of Python 3’s design, where str is indistinguishable from UTF-8 except insofar as you need to actually ask for bytes (e.g. call encode()) to get the UTF-8 bytes.
> Also, file operations should always work on bytestreams
So how do you read a line from a text file?
> (same in the IO functions of the C stdlib btw).
Are we talking about the same C? The language where calling gets() at all is a severe security bug, where fgets returns int, and where fgetwc exists?