Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
a53caf28
Kaydet (Commit)
a53caf28
authored
Eyl 23, 2013
tarafından
Daley Chetwynd
Kaydeden (comit)
Tim Graham
Eyl 23, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #20830 -- Clarified that Django uses a customized version of six.
Thanks glarrain for the suggestion.
üst
6a30075e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
python3.txt
docs/topics/python3.txt
+13
-11
No files found.
docs/topics/python3.txt
Dosyayı görüntüle @
a53caf28
...
...
@@ -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
c
onvenience, 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
c
ustomized 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
...
...
@@ -328,8 +328,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.
...
...
@@ -364,8 +364,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
compatible location to import them.
PY2
~~~
...
...
@@ -380,10 +381,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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment