[Terence Way] > There is a rather pleasing symmetry between > raise SomeClass, arg > and > assert expr, arg > > Is this intentional? If so, should the assert form be deprecated as > well? The symmetry is purely syntactic, and is misleading: assert is a control structure, and doesn't evaluate "arg" unless the runtime value of expr is false. For example, >>> assert True, 1/0 >>> assert False, 1/0 Traceback (most recent call last): File "<stdin>", line 1, in ? ZeroDivisionError: integer division or modulo by zero >>> raise always evaluates its arg.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4