Zito Relova
Feb 10, 2021

--

Hey, thanks for taking the time to read my article! Generally, assertions are kept out of production code and used only during testing. In production, you would probably want to raise a proper exception rather than use assertions. Little known fact: if you dig in the python docs a bit, you'll find that assertions are actually omitted when compilation is optimized. https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement

Hope this helps!

--

--

Zito Relova
Zito Relova

Written by Zito Relova

I write about data science and machine learning.

No responses yet