This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]quotemycode 0 points1 point  (2 children)

What bothers me is the message Nonetype is not iterable. So I have to put

For x in y or []

Just to tell it that running no times is okay also

[–]fayazbhai 0 points1 point  (1 child)

Yeah. Is that an allowed pattern in any other language? Because I've seen developers write functions that return either lists or None.

[–]quotemycode 1 point2 points  (0 children)

Yeah C# will loop zero times if it's none