• Kirill Smelkov's avatar
    *: dict.keys() returns sequence, not [] on py3 · 7851a964
    Kirill Smelkov authored
    The sequence cannot be randomly accessed, e.g.
    
        In [5]: d = {1:2}
    
        In [6]: kv = d.keys()
    
        In [7]: kv
        Out[7]: dict_keys([1])
    
        In [8]: kv[0]
        ---------------------------------------------------------------------------
        TypeError                                 Traceback (most recent call last)
        <ipython-input-8-643f90e1910b> in <module>()
        ----> 1 kv[0]
    
        TypeError: 'dict_keys' object is not subscriptable
    
    -> Use list(dict.keys()) in places where we need random access.
    7851a964
Name
Last commit
Last update
..
test Loading commit data...
__init__.py Loading commit data...
help.py Loading commit data...
util.py Loading commit data...
zodb.py Loading commit data...
zodbanalyze.py Loading commit data...
zodbcmp.py Loading commit data...
zodbcommit.py Loading commit data...
zodbdump.py Loading commit data...
zodbinfo.py Loading commit data...