I found that Python\'s assert statement is a good way to catch situations that should never happen. And it can be removed by Python optimization when the code is trusted to be c
As per my experience, asserts are majorly used in development phase of a program-to check the user defined inputs. asserts are not really needed to catch programming errors. Python itself is very well capable of trapping genuine programming errors like ZeroDivisionError, TypeError or so.