Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.5.x] Fixed #20830 -- Clarified that Django uses a customized versi…

…on of six.

Thanks glarrain for the suggestion.

Backport of a53caf2 from master
  • Loading branch information...
commit c695f293e3ce74657268e532ee69ae64c92bfa1c 1 parent a722dfd
@dchetwynd dchetwynd authored timgraham committed
Showing with 13 additions and 11 deletions.
  1. +13 −11 docs/topics/python3.txt
View
24 docs/topics/python3.txt
@@ -26,10 +26,10 @@ to stay compatible with Python 2. But authors of pluggable applications are
encouraged to use the same porting strategy as Django itself.
Writing compatible code is much easier if you target Python ≥ 2.6. Django 1.5
-introduces compatibility tools such as :mod:`django.utils.six`. For
-convenience, forwards-compatible aliases were introduced in Django 1.4.2. If
-your application takes advantage of these tools, it will require Django ≥
-1.4.2.
+introduces compatibility tools such as :mod:`django.utils.six`, which is a
+customized version of the :mod:`six module <six>`. For convenience,
+forwards-compatible aliases were introduced in Django 1.4.2. If your
+application takes advantage of these tools, it will require Django ≥ 1.4.2.
Obviously, writing compatible source code adds some overhead, and that can
cause frustration. Django's developers have found that attempting to write
@@ -325,8 +325,8 @@ Writing compatible code with six
six_ is the canonical compatibility library for supporting Python 2 and 3 in
a single codebase. Read its documentation!
-:mod:`six` is bundled with Django as of version 1.4.2. You can import it as
-:mod:`django.utils.six`.
+A :mod:`customized version of six <django.utils.six>` is bundled with Django
+as of version 1.4.2. You can import it as ``django.utils.six``.
Here are the most common changes required to write compatible code.
@@ -361,8 +361,9 @@ Import ``six.moves.xrange`` wherever you use ``xrange``.
Moved modules
~~~~~~~~~~~~~
-Some modules were renamed in Python 3. The :mod:`django.utils.six.moves
-<six.moves>` module provides a compatible location to import them.
+Some modules were renamed in Python 3. The ``django.utils.six.moves``
+module (based on the :mod:`Python six.moves module <six.moves>`) provides a
@aaugustin Owner

This sentence implies that six is part of the standard library, which isn't true. It's maintained externally by a Python core dev.

@timgraham Owner

thanks -- caught one instance of that in the original patch but missed this one. fixed in 45969bd and backports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+compatible location to import them.
The ``urllib``, ``urllib2`` and ``urlparse`` modules were reworked in depth
and :mod:`django.utils.six.moves <six.moves>` doesn't handle them. Django
@@ -388,10 +389,11 @@ function.
.. module:: django.utils.six
-Customizations of six
----------------------
+Django customized version of six
+--------------------------------
-The version of six bundled with Django includes a few extras.
+The version of six bundled with Django (``django.utils.six``) includes a few
+extras.
.. function:: assertRaisesRegex(testcase, *args, **kwargs)
Please sign in to comment.
Something went wrong with that request. Please try again.