aboutcode-org / aboutcode-org/aboutcode

Replace and rewrite "assert" statements in non-test code

未關閉
#175 48 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
easy good first issue
主要語言
Batchfile
星號
302
分支
249
平均合併
1 天 9 小時
30 天內合併 PR
2

描述

See https://www.reddit.com/r/learnpython/comments/zd217y/is_using_assert_considered_good_practice/

> assert statements should only be used for debugging purposes. They are removed when not running in debug mode (i.e. when invoking the Python command with the -O or -OO options).

> Instead use a raise statement to throw a proper, informative runtime exception, if you need to. That would definitely be best practice when there'd otherwise be no sensible return value for the function.

We are using a few asserts in our main code. See https://github.com/search?q=org%3Aaboutcode-org+NOT+path%3A*test*++"assert"++language%3APython&type=code

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。