Message118420
| Author |
pitrou |
| Recipients |
pitrou, r.david.murray, shashank |
| Date |
2010年10月12日.12:34:11 |
| SpamBayes Score |
3.6957354e-10 |
| Marked as misclassified |
No |
| Message-id |
<1286886853.68.0.569196405129.issue10030@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年10月12日 12:34:13 | pitrou | set | recipients:
+ pitrou, r.david.murray, shashank |
| 2010年10月12日 12:34:13 | pitrou | set | messageid: <1286886853.68.0.569196405129.issue10030@psf.upfronthosting.co.za> |
| 2010年10月12日 12:34:12 | pitrou | link | issue10030 messages |
| 2010年10月12日 12:34:12 | pitrou | create |
|