aboutcode-org / aboutcode-org/aboutcode

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

オープン
#175 コメント 48 件 リアクション 0 件 担当者 0 名 GitHub で見る
easy good first issue
主要言語
Batchfile
スター
302
フォーク
249
平均マージ
1日 9時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。