[PYTHON-CRYPTO] Requirements
Michael Ströder
michael at STROEDER.COM
Tue Feb 13 07:54:53 CET 2001
Jeremy Hylton wrote:
>
> >>>>> "R$" == Rich Salz <rsalz at CAVEOSYSTEMS.COM> writes:
>
> >> > * At least in debug mode an exception should be raised if the
> >> > application passes wrong types of parameters to class methods
> >> > of the API.
> >> I think this should be done all of the time, not just in debug
> >> mode.
>
> R$> Once my code is written I do not want to pay the overhead
> R$> of run-time typechecking.
>
> I agree. The Python standard library does very minimal
> type-checking. Instead, the philosophy is that if a user supplies an
> argument of the wrong type, an exception will be raised when the value
> is actually used. In many cases, the traceback is as clear as one
> generated by an explicit type check.
Just two notes:
1. An API where the application is independent of a specific
implementation (dynamic registration) makes it possible to have a
debug module and a more efficient module for production use.
2. Python tracebacks are most times sufficient but not always.
Jeremy, think of some deeply nested ASN.1 structures mapped to
deeply nested Python classes which almost have the same attributes.
Getting some experience in this field was time-consuming... ;-)
Ciao, Michael.
More information about the python-crypto
mailing list