Skip to content

Commit 417d894

Browse files
committed
Adds further reading section with links.
1 parent 7849960 commit 417d894

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

doc/sphinx/source/further_reading.rst

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.. highlight:: python
2+
:linenothreshold: 10
3+
4+
.. toctree::
5+
:maxdepth: 3
6+
7+
.. _further_reading:
8+
9+
============================================
10+
Further Reading
11+
============================================
12+
13+
14+
--------------------------------------------
15+
Useful Links
16+
--------------------------------------------
17+
18+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19+
C Extensions
20+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21+
22+
* python.org Tutorial: `https://docs.python.org/3/extending/index.html <https://docs.python.org/3/extending/index.html>`_
23+
* python.org C/C++ reference: `https://docs.python.org/3/c-api/index.html <https://docs.python.org/3/c-api/index.html>`_
24+
* Joe Jevnik's "How to Write and Debug C Extension Modules":
25+
* Documentation: `https://llllllllll.github.io/c-extension-tutorial/index.html <https://llllllllll.github.io/c-extension-tutorial/index.html>`_
26+
* Code: `https://github.com/llllllllll/c-extension-tutorial <https://github.com/llllllllll/c-extension-tutorial>`_
27+
28+
29+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30+
Porting to Python 3
31+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
33+
* General, and comprehensive: `http://python3porting.com/ <http://python3porting.com/>`_
34+
* Porting Python 2 code to Python 3: `https://docs.python.org/3/howto/pyporting.html <https://docs.python.org/3/howto/pyporting.html>`_
35+
* Porting C Extensions to Python 3: `https://docs.python.org/3/howto/cporting.html <https://docs.python.org/3/howto/cporting.html>`_
36+
* ``py3c``: Python 2/3 compatibility layer for C extensions:
37+
* Documentation: `https://py3c.readthedocs.io/en/latest/ <https://py3c.readthedocs.io/en/latest/>`_
38+
* Project: `https://github.com/encukou/py3c <https://github.com/encukou/py3c>`_
39+
40+
41+
42+

doc/sphinx/source/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This describes reliable patterns of coding Python Extensions in C. It covers the
2323
debugging/debug
2424
thread_safety
2525
miscellaneous
26+
further_reading
2627

2728

2829
Indices and tables

doc/sphinx/source/refcount.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ The contract with *new* references is: either you decref it or give it to someon
198198

199199
This is also to do with object creation but where another object takes responsibility for decref'ing (possibly freeing) the object. Typical examples are when you create a ``PyObject`` that is then inserted into an existing container such as a tuple list, dict etc.
200200

201-
The analogy with C code is malloc'ing some memory, populating it and then passing that pointer to a linked list which then takes on the responsibility to free the memory if that item in the list is removed.
201+
The analogy with C code is malloc'ing some memory, populating it and then passing that pointer to a linked list which then takes on the responsibility to free the memory if that item in the list is removed. If you were to free the memory you had malloc'd then you will get a double free when the linked list (eventually) frees its members.
202202

203203
Here is an example of creating a 3-tuple, the comments describe what is happening contractually:
204204

0 commit comments

Comments
 (0)