IssueRaiser

Possible to distinguish between Sequence[str]/Iterable[str] and str?

If a function expects an iterable of strings, is it possible to forbid passing in a string, since strings are iterable? Seems like there are many cases where this would be an error, but I don't see an obvious way to check 't','h','i','s'.

Posted by jtatum on Jul 29, 2016, 11:15 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.5,000 issues0 comments

github (Other)

Possible to distinguish between Sequence[str]/Iterable[str] and str?

jtatumJul 29, 2016, 11:15 PM

If a function expects an iterable of strings, is it possible to forbid passing in a string, since strings are iterable? Seems like there are many cases where this would be an error, but I don't see an obvious way to check 't','h','i','s'.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue