>>> for line in StringIO("foo\x85bar\vquux\u2028zoot"): print(line)
...
foo
bar
quux zoot >>> from io import StringIO
>>> for line in StringIO("foo\x85bar\vquux\u2028zoot"): print(repr(line))
...
'foo\x85bar\x0bquux\u2028zoot'For string you’d need to
import io
for line in io.StringIO(str):
passIn my experience, they're not. It's strings.
From database fields, API calls, JSON values, HTML tag content, function inputs generally, you know -- the normal places.
In my experience, most people aren't dealing directly with files (or streams) most of the time.
I also used the word generally, so your insistence on quantifying the proportion is a complete waste of time.
And I said your "generally" was wrong. You were provided general advice, I'm saying it's wrong in general. Do you see me giving numerical quantities anywhere?
There are countless sources one can get a string from. Surely you don't think filesystems are the only source of strings?
Surely you haven't misread my comments above to such an extent? Perhaps not familiar with sockets.