[PYTHON-CRYPTO] not pseudo code anymore!

Michael Ströder michael at STROEDER.COM
Sat Feb 17 20:01:26 CET 2001


Jeremy Hylton wrote:
>
> Asserts should not be used for typechecking.  They are intended for
> internal application sanity checking.  If a library raises an
> assertion error, there is a bug in the library.  If there is a problem
> with user code, e.g. the wrong arguments, the user should get an
> exception like TypeError or ValueError.

Hmm, I wanted to mandate type-checking in kind of a style guide for
implementations. Do you have an idea how to achieve this goal in a
generic way? Off course TypeError or ValueError should be raised.
But if we have no access methods for attributes it's pretty ugly to
implement the check statements.

Ciao, Michael.





More information about the python-crypto mailing list