Issue #26462: Merge code block fixes from 3.5

This commit is contained in:
Martin Panter 2016-07-29 01:49:37 +00:00
commit 6a09315ff0
47 changed files with 329 additions and 128 deletions

View file

@ -55,7 +55,9 @@ Since distutils also supports creation of binary packages, users don't
necessarily need a compiler and distutils to install the extension.
A distutils package contains a driver script, :file:`setup.py`. This is a plain
Python file, which, in the most simple case, could look like this::
Python file, which, in the most simple case, could look like this:
.. code-block:: python3
from distutils.core import setup, Extension
@ -96,7 +98,9 @@ file, :file:`demo.c`.
In many cases, building an extension is more complex, since additional
preprocessor defines and libraries may be needed. This is demonstrated in the
example below. ::
example below.
.. code-block:: python3
from distutils.core import setup, Extension
@ -161,4 +165,3 @@ commands can be used to do so. ::
python setup.py bdist_wininst
python setup.py bdist_rpm
python setup.py bdist_dumb

View file

@ -157,7 +157,9 @@ script, such as:
c = c + b
return c
then the result should be::
then the result should be:
.. code-block:: shell-session
$ call multiply multiply 3 2
Will compute 3 times 2
@ -291,16 +293,20 @@ available). This script has several options, of which the following will
be directly useful to you:
* ``pythonX.Y-config --cflags`` will give you the recommended flags when
compiling::
compiling:
$ /opt/bin/python3.4-config --cflags
-I/opt/include/python3.4m -I/opt/include/python3.4m -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
.. code-block:: shell-session
$ /opt/bin/python3.4-config --cflags
-I/opt/include/python3.4m -I/opt/include/python3.4m -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
* ``pythonX.Y-config --ldflags`` will give you the recommended flags when
linking::
linking:
$ /opt/bin/python3.4-config --ldflags
-L/opt/lib/python3.4/config-3.4m -lpthread -ldl -lutil -lm -lpython3.4m -Xlinker -export-dynamic
.. code-block:: shell-session
$ /opt/bin/python3.4-config --ldflags
-L/opt/lib/python3.4/config-3.4m -lpthread -ldl -lutil -lm -lpython3.4m -Xlinker -export-dynamic
.. note::
To avoid confusion between several Python installations (and especially

View file

@ -792,7 +792,9 @@ the format string is empty, it returns ``None``; if it contains exactly one
format unit, it returns whatever object is described by that format unit. To
force it to return a tuple of size 0 or one, parenthesize the format string.
Examples (to the left the call, to the right the resulting Python value)::
Examples (to the left the call, to the right the resulting Python value):
.. code-block:: none
Py_BuildValue("") None
Py_BuildValue("i", 123) 123
@ -1348,4 +1350,3 @@ code distribution).
.. [#] These guarantees don't hold when you use the "old" style calling convention ---
this is still found in much existing code.

View file

@ -209,7 +209,9 @@ That's it! All that remains is to build it; put the above code in a file called
setup(name="noddy", version="1.0",
ext_modules=[Extension("noddy", ["noddy.c"])])
in a file called :file:`setup.py`; then typing ::
in a file called :file:`setup.py`; then typing
.. code-block:: shell-session
$ python setup.py build
@ -1513,4 +1515,3 @@ might be something like the following::
.. [#] Even in the third version, we aren't guaranteed to avoid cycles. Instances of
string subclasses are allowed and string subclasses could allow cycles even if
normal strings don't.