Assertions can be disabled with the -O value when running Python. For this reason, use statements only to verify that it is working, and not to verify that it is part of your program logic.
Also, of course, there is a difference in the fact that statements raise an AssertionError that you really shouldn't catch. When you throw an exception, you can make the type of exception suitable for the error and catch it later.
source share