3 ms·
> The people making this argument don't realize that every for loop in Python is always exited via an exception. It's just all memory addresses under the hood,
by spicybright 5y ago
> The people making this argument don't realize that every for loop in Python is always exited via an exception.
It's just all memory addresses under the hood, so why bother with variable names?
Only throwing exception objects is a layer of abstraction that makes error handling easier to handle.
Nearly all python libraries follow this pattern, and it's extremely easy to pass any variable you want to your custom exception for you to handle however you want.