Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue15656] "Extending Python with C" page needs update for 3.x

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Aug 14, 2012, 11:57 AM

Post #1 of 7 (86 views)
Permalink
[issue15656] "Extending Python with C" page needs update for 3.x

New submission from Sandro Tosi:

Hello,
this has been reported at http://mail.python.org/pipermail/docs/2012-July/009223.html but since I have no experience to judge if it's correct or not, i'll just report it:

>>>
I've recenty started to try using C code in python using the wonderful
python API, although i have to say the learning curve was non neglectable :P
I've spotted what I believe to be a small mistake in the documentation
from this page:
http://docs.python.org/release/3.2/extending/extending.html

In paragraph 1.8
(http://docs.python.org/release/3.2/extending/extending.html#keyword-parameters-for-extension-functions),
the code example given contains an error, which is actually obsolete
code from python 2.7:

void
initkeywdarg(void)
{
/* Create the module and add the functions */
Py_InitModule("keywdarg", keywdarg_methods);
}


This doesn't work in Python3.2. It's supposed to be

static struct PyModuleDef keywdargmodule = {
PyModuleDef_HEAD_INIT,
"keywdarg", /* name of module */
keywdarg_doc, /* module documentation, may be NULL */
-1, /* size of per-interpreter state of the module,
or -1 if the module keeps state in global variables. */
keywdarg_methods
};

PyMODINIT_FUNC
PyInit_keywdarg(void)
{
return PyModule_Create(&keywdargmodule);
}

As explained above (and confirmed by experience).
<<<

----------
assignee: docs [at] pytho
components: Documentation
messages: 168223
nosy: docs [at] pytho, sandro.tosi
priority: normal
severity: normal
stage: patch review
status: open
title: "Extending Python with C" page needs update for 3.x
versions: Python 3.2, Python 3.3

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15656>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 15, 2012, 4:41 AM

Post #2 of 7 (79 views)
Permalink
[issue15656] "Extending Python with C" page needs update for 3.x [In reply to]

Changes by Eli Bendersky <eliben [at] gmail>:


----------
nosy: +eli.bendersky

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15656>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 15, 2012, 4:52 AM

Post #3 of 7 (78 views)
Permalink
[issue15656] "Extending Python with C" page needs update for 3.x [In reply to]

Roundup Robot added the comment:

New changeset 599376deeeac by Eli Bendersky in branch '3.2':
Issue #15656: fixing code sample in extending doc
http://hg.python.org/cpython/rev/599376deeeac

----------
nosy: +python-dev

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15656>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 15, 2012, 4:53 AM

Post #4 of 7 (79 views)
Permalink
[issue15656] "Extending Python with C" page needs update for 3.x [In reply to]

Eli Bendersky added the comment:

Fixed, thanks for the report.

----------
resolution: -> fixed
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15656>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 15, 2012, 12:34 PM

Post #5 of 7 (78 views)
Permalink
[issue15656] "Extending Python with C" page needs update for 3.x [In reply to]

Changes by Jesús Cea Avión <jcea [at] jcea>:


----------
nosy: +jcea

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15656>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 15, 2012, 12:35 PM

Post #6 of 7 (80 views)
Permalink
[issue15656] "Extending Python with C" page needs update for 3.x [In reply to]

Jesús Cea Avión added the comment:

Should this be applied to "default" (3.3) too?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15656>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 15, 2012, 12:40 PM

Post #7 of 7 (78 views)
Permalink
[issue15656] "Extending Python with C" page needs update for 3.x [In reply to]

Sandro Tosi added the comment:

It's fixed in default too: http://hg.python.org/cpython/rev/f46b4b7b817c

It was not shown because the commit message misses the issue reference.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15656>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.