Skip to content

Commit 8f40e86

Browse files
committed
README: set Python syntax highlighting
1 parent 3fae227 commit 8f40e86

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

README.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ Code examples
5757
Replacements for Py2's built-in functions and types are designed to be imported
5858
at the top of each Python module together with Python's built-in ``__future__``
5959
statements. For example, this code behaves identically on Python 2.6/2.7 after
60-
these imports as it does on Python 3.3+::
60+
these imports as it does on Python 3.3+:
61+
62+
.. code-block:: python
6163
6264
from __future__ import absolute_import, division, print_function
6365
from future.builtins import (bytes, str, open, super, range,
@@ -127,7 +129,9 @@ these imports as it does on Python 3.3+::
127129
128130
129131
There is also support for renamed standard library modules in the form of import
130-
hooks. The context-manager form works like this::
132+
hooks. The context-manager form works like this:
133+
134+
.. code-block:: python
131135
132136
from future import standard_library
133137
@@ -164,15 +168,19 @@ mostly unchanged on both Python 2 and Python 3.
164168
Futurize: 2 to both
165169
--------------------
166170

167-
For example, running ``futurize -w mymodule.py`` turns this Python 2 code::
171+
For example, running ``futurize -w mymodule.py`` turns this Python 2 code:
172+
173+
.. code-block:: python
168174
169175
import ConfigParser
170176
171177
class Blah(object):
172178
pass
173179
print 'Hello',
174180
175-
into this code which runs on both Py2 and Py3::
181+
into this code which runs on both Py2 and Py3:
182+
183+
.. code-block:: python
176184
177185
from __future__ import print_function
178186
from future import standard_library

0 commit comments

Comments
 (0)