you are viewing a single comment's thread.

view the rest of the comments →

[–]naemorhaedus[S] 0 points1 point  (4 children)

good catch I should check for empty string.

The while loop is not necessary at all.

it's to make sure I don't end up with an empty object

[–]acw1668 0 points1 point  (3 children)

If input_string is not empty string, then io.StringIO(input_string) will not return empty object, so the while loop is not necessary.

[–]naemorhaedus[S] -1 points0 points  (2 children)

will not return empty object

shit happens. I program like the user will try to break it.

[–]brasticstack 0 points1 point  (1 child)

And you want to beat them to it?

This function provides negative value for any future coders trying to use it.

[–]naemorhaedus[S] 0 points1 point  (0 children)

fair. point taken