3 ms·
Python has excellent exception handling, and its corollary to if err != nil would be try/except blocks everywhere. That said, I hate Go for unrelated reasons,
by sgarland 3y ago
Python has excellent exception handling, and its corollary to if err != nil would be try/except blocks everywhere.
That said, I hate Go for unrelated reasons, and love Python.
- randomdata 3y agoGo's exception handling (panic/recover) is very much like most other languages with exception handling, including Python. It is there to use when you have exceptions. But we're talking about expected failure (network failure, hardware failure, etc.), not exceptional cases (programmer error). You would not want to carry 'expecteds' on exception handlers. Different tools for different jobs. That said, systems transcend Go. The discussion isn't about Go, or Python, specifically.