manubot / manubot-ai-editor

BSD 3-Clause "New" or "Revised" License
39 stars 9 forks source link

Replace `assert` statements in production code #64

Open d33bs opened 3 weeks ago

d33bs commented 3 weeks ago

While looking through some of the code I noticed the use of assert statements within the production code (for example, here). It's generally recommended to avoid the use of assert statements within production code as the Python interpreter has a mode which allows ignoring these statements when processed (using the -O flag, for example python -O <file>). These existing assert statements could be turned into try except's instead to help avoid this challenge and follow Pythonic conventions.