aboutcode-org / aboutcode-org/aboutcode

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

Đang mở
#175 48 bình luận 0 reaction 0 người được giao Xem trên GitHub
easy good first issue
Ngôn ngữ chính
Batchfile
Star
302
Fork
249
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
2

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.