Changes between Version 13 and Version 14 of DeveloperGuidelines/Py_2_3


Ignore:
Timestamp:
06/26/19 19:23:19 (5 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/Py_2_3

    v13 v14  
    9393||INTEGER_TYPES||{{{from s3compat import INTEGER_TYPES}}}||maps to tuple of all known integer types: (int,long) in Py2, (int,) in Py3), for use with {{{isinstance}}}||
    9494
    95 === No dict.iteritems ===
     95=== No dict.iteritems, iterkeys or itervalues ===
    9696
    97 Python-3 does not support {{{dict.iteritems()}}}. We use {{{dict.items()}}} instead:
     97Python-3 does no longer have {{{dict.iteritems()}}}. We use {{{dict.items()}}} instead:
    9898
    9999{{{#!python
     
    105105
    106106NB In Python-2, {{{dict.items()}}} returns a list of tuples, but in Python-3 it returns a dict view object that is sensitive to changes of the dict. If a list is required, or the dict is changed inside the loop, the result of {{{dict.items()}}} must be converted into a list explicitly.
     107
     108The same applies to {{{dict.iterkeys()}}} (use {{{dict.keys()}}} instead) and {{{dict.itervalues()}}} (use {{{dict.values()}}} instead).
     109