如何在Python中禁用断言?
也就是说,如果一个断言失败了,我不希望它抛出AssertionError,但继续前进.
AssertionError
我怎么做?
python debugging assert exception-handling environment-variables
Python的-O switch strip从它编译的代码断言.
Python的-OO开关执行此操作并删除文档字符串.
有没有办法让Python剥离文档字符串而不是断言?
特别是,这可以从命令行还是使用内置的编译功能?
python
python ×2
assert ×1
debugging ×1
environment-variables ×1
exception-handling ×1