Re:It’s Not Wrong that “ ”.length == 7
by L3viathan on Friday June 02, 2023 @03:51AM
(#36162339)
It is useful: When iterating over a string in Python (which I hope you agree _is_ useful?), you get that many parts.
[ Parent
| on HN ]
> It is useful: When iterating over a string in Python (which I hope you agree _is_ useful?), you get that many parts.
That’s… not useful?
I can’t say I remember ever caring knowing how many items I would be getting during an iteration[0]. If I want to set an iteration limit I can just… do that, using `islice` or some such.
[0] in python anyway, in lower level language there can be a utility in order to pre-allocate an output collection
Re:It’s Not Wrong that “ ”.length == 7
by chrismorgan on Friday June 02, 2023 @04:03AM
(#36162423)
> When iterating over a string in Python (which I hope you agree _is_ useful?)
Not often. There’s almost nothing useful you can correctly do with a sequence of code points.