[PYTHON-CRYPTO] not pseudo code anymore!

PC Drew drewpc at COLORADO.EDU
Sat Feb 17 21:33:27 CET 2001


Quoting Jeremy Hylton <jeremy at alum.mit.edu>:

> A few comments on the PyCrypto code.  You've got a bunch of explicit
> assignments to __doc__:
>
> class SymmetricBase:
>         __doc__ = """
>             All symmetric algorithms must inherit from this base class.
>         """
>
>         __encryptKey = None
>         __keySize = None
>
>         def __init__(self, _encryptKey = None):
>                 __doc__ = """
>                     _encryptKey = default encrypt key
>
>                     1. check the key for validity and raise an error if
> it's not right
>                     2. set the key to be member variable
>                 """
>
> The __doc__ assignment are redundant for the class and incorrect for
> the functions.  For the function, you're creating a local variable
> named __doc__.  The correct way to write this is:
>
> class SymmetricBase:
>         """All symmetric algorithms must inherit from this base
> class."""
>
>         __encryptKey = None
>         __keySize = None
>
>         def __init__(self, _encryptKey = None):
>                 """"_encryptKey = default encrypt key
>
>                 1. check the key for validity and raise an error if
>                    it's not right
>                 2. set the key to be member variable
>                 """
>
> Also, it is typically to limit lines to less than 80 characters.
>
> Jeremy
>

Thank you, I didn't know that.  I'll change that and post a revision.

--
PC Drew





More information about the python-crypto mailing list