msg121329 - (view) |
Author: Alexander Belopolsky (belopolsky) *  |
Date: 2010-11-17 00:08 |
Python Codec Registry and support functions are well documented in codecs.h header file. It should be easy to convert that to reST. |
|
|
msg121603 - (view) |
Author: Eli Bendersky (eli.bendersky) *  |
Date: 2010-11-20 10:42 |
I will write a codecs.rst for this. Any suggestion of where in c-api/index.html it should be linked? |
|
|
msg121606 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2010-11-20 10:51 |
Please call it codec.rst. It is probably best placed under "utilities". |
|
|
msg121613 - (view) |
Author: Eli Bendersky (eli.bendersky) *  |
Date: 2010-11-20 11:27 |
While preparing a .rst document for this, I ran into a possible inaccuracy in a comment in codecs.h: /* Lookup the error handling callback function registered under the name error. As a special case NULL can be passed, in which case the error handling callback for "strict" will be returned. */ PyAPI_FUNC(PyObject *) PyCodec_LookupError(const char *name); ---- The problem may be with the phrase "under the name error". Shouldn't it be just "under *name*"? |
|
|
msg121614 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2010-11-20 11:31 |
Yes, apparently the parameter was (intended to be) called "error" at some point. Can you put the correction in your patch? |
|
|
msg121620 - (view) |
Author: Eli Bendersky (eli.bendersky) *  |
Date: 2010-11-20 12:26 |
Submitting a patch. What was touched: 1. Include/codecs.h - minor inaccuracy and inconsistency in a comment 2. Doc/c-api/codec.rst - new reST documentation file for the codecs.h C API 3. Doc/c-api/utilities.rst - for linking to codec.rst, per Georg's suggestion |
|
|
msg121629 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2010-11-20 13:02 |
Thanks for the patch, it looks good, I have 2 remarks though: - "under the name name" could be replaced by "under the given name". - "The *search_function*'s refcount is incremented by this function." This information is not useful to the caller - she just wants to know whether she still owns the reference she had before. Most probably here, the refcount is incremented because the object is stored in a list; the caller still owns the reference to the parameter, like most functions of the API, and there is nothing to say about refcounts here. |
|
|
msg121632 - (view) |
Author: Eli Bendersky (eli.bendersky) *  |
Date: 2010-11-20 13:18 |
Amaury, Thanks for the review & comments. I'm attaching a fixed patch. |
|
|
msg121633 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2010-11-20 13:18 |
Please also keep to 3-space indentation in directives. |
|
|
msg121636 - (view) |
Author: Eli Bendersky (eli.bendersky) *  |
Date: 2010-11-20 13:22 |
Georg, Thanks. Submitting fixed patch with 3-space indentation in directives. |
|
|
msg121640 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2010-11-20 13:45 |
Reviewed and applied in r86562. Thanks! |
|
|