Antoine Pitrou <pit...@free.fr> added the comment:

Hello,

Some quick comments:
- the C module should be private and therefore called _zipdecrypt
- if you want to avoid API mismatch, you could give a tp_call to your C 
decrypter object, rather than a "decrypt" method
- you can put all initialization code in zipdecrypt_new and avoid the need for 
zipdecrypt_init
- it's better to use the "y*" code in PyArg_ParseTuple, rather than "s#"
- you should define your module as PY_SSIZE_T_CLEAN and use Py_ssize_t as 
length variables (rather than int)
- you *mustn't* change the contents of the buffer which is given you by "s#" or 
"y*", since that buffer is read-only (it can be a bytes object); instead, 
create a new bytes object using PyBytes_FromStringAndSize(NULL, length) and 
write into that; or, if you want a read-write buffer, use the "w*" code

----------
nosy: +pitrou
stage:  -> patch review
versions: +Python 3.2 -Python 2.7

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

Reply via email to