On 2019-04-11 00:09, Stefano Borini wrote:
I occasionally found situations where I want to raise an exception for errors that can only arise because the developer made a mistake, for example:
I use AssertionError for this. An assertion failure means "this is a bug", so that seems the right choice to me. You don't need to use an actual assert statement, you can manually raise AssertionError too.
Jeroen. _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/