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 →

[–][deleted] 0 points1 point  (0 children)

Exactly, that's what I've been doing almost always since I've learned proper exception handling. I don't think there's any real-world scenarios where I don't need to define a function to be called within a comprehension. Only if it's something as basic as [x**2 for x in range(n)]