Nicolas Dumazet <nicd...@gmail.com> added the comment:

Hello,

1) Can you please avoid putting several statements in the same line?

2) wouldnt it be better to compute only once the contents of methods()? I'm not 
sure that module-initialization time is okay for CPython, but at the very least 
you can lazily fill a module-level variable, and return it directly from 
methods()?

3) what happens when a user uses one of the Crypt methods that are referenced 
from the Module, if this method is not available? Arguably, if I know what I'm 
doing, I will call mksalt(METHOD_SHA512) without checking that METHOD_SHA512 
was in methods(). That's not very intuitive, and it seems that mksalt could 
break.

4) saltchars should probably be string.ascii_letters+string.digits instead of 
the hardcoded value

5) you should mention in the documentation that if not salt parameter is given, 
a different salt will be used for each crypt() call

6) is _MethodClass an old-style class?

7) it seems that the patch duplicates twice the diff of crypt.py, not sure of 
what happened there?

----------
nosy: +nicdumz

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10924>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to