mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
[py3] Updated dict-like data structures for Python 3.
The keys/items/values methods return iterators in Python 3, and the iterkeys/items/values methods don't exist in Python 3. The behavior under Python 2 is unchanged.
This commit is contained in:
parent
4b5cb116e3
commit
ab6cd1c839
4 changed files with 140 additions and 87 deletions
|
@ -120,3 +120,18 @@ If you need different code in Python 2 and Python 3, check :data:`six.PY3`::
|
|||
|
||||
This is a last resort solution when :mod:`six` doesn't provide an appropriate
|
||||
function.
|
||||
|
||||
.. module:: django.utils.six
|
||||
|
||||
Customizations of six
|
||||
=====================
|
||||
|
||||
The version of six bundled with Django includes a few additional tools:
|
||||
|
||||
.. function:: iterlists(MultiValueDict)
|
||||
|
||||
Returns an iterator over the lists of values of a
|
||||
:class:`~django.utils.datastructures.MultiValueDict`. This replaces
|
||||
:meth:`~django.utils.datastructures.MultiValueDict.iterlists()` on Python
|
||||
2 and :meth:`~django.utils.datastructures.MultiValueDict.lists()` on
|
||||
Python 3.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue