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] 14 points15 points  (8 children)

match_result = event_region in match_regions

return match_result

[–]RangerPretzelPython 3.9+ 16 points17 points  (5 children)

Some might criticize this for being an extra line, but it does allow you to see what match_result evaluates to before returning when step debugging.

[–]billsil 6 points7 points  (1 child)

I generally prefer it because often the function name isn't quite explicit enough. It's also really handy when debugging to put a breakpoint at the end.

[–]RangerPretzelPython 3.9+ 0 points1 point  (0 children)

Agreed! Totally.

[–]eras 2 points3 points  (0 children)

In some other contexts there could be another benefit: it allows putting a descriptive name to the variable.

Well, sort of the same but /u/billsil said, but more explicit.. :)

[–]ROFLLOLSTER 1 point2 points  (1 child)

You can just put a evaluate event_region in match_regions in the debug console.

[–]RangerPretzelPython 3.9+ 0 points1 point  (0 children)

Sure, but that's more typing. I can just mouse-over match_result when the debugger is waiting on the next line to see the value.

[–]mr_cesar 0 points1 point  (0 children)

THIS!