pyauth / requests-http-signature

A Requests auth module for the IETF HTTP Message Signatures draft standard

Home Page:https://pyauth.github.io/requests-http-signature/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python's assert can be disabled

calvin620707 opened this issue · comments

https://stackoverflow.com/questions/1273211/disable-assertions-in-python

I can help to send an MR to remove assert and replaced with raising exception if it makes sense to remove assert for verification.

Thanks for pointing this out. My general suggestion for this type of issue is to not disable assertions.

PRs are welcome.

commented

👍

See Dan Bader's tutorial https://dbader.org/blog/python-assert-tutorial , in caveat nr 1 he states :

Caveat #1 – Don’t Use Asserts for Data Validation
Asserts can be turned off globally in the Python interpreter. Don’t rely on assert expressions to be executed for data validation or data processing.

The latest implementation does not use assert statements for verification.