Module Expr Str Import alias Import alias ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Call AttributeLoad Call NameLoad attr NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareEq Call AttributeLoad NameLoad attr NameLoad NameLoad body Raise Call NameLoad NameLoad Return SubscriptLoad NameLoad Index Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return CompareIn Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign SubscriptStore AttributeLoad NameLoad attr Index Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad kwarg body If CompareIsNot NameLoad NameLoad body If Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad NameLoad attr orelse Assign NameStore GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore NameLoad For TupleStore NameStore NameStore NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list
N/A N/A StrKeyDict always converts non-string keys to `str`

Tests for item retrieval using `d[key]` notation::

    >>> d = StrKeyDict([('2', 'two'), ('4', 'four')])
    >>> d['2']
    'two'
    >>> d[4]
    'four'
    >>> d[1]
    Traceback (most recent call last):
      ...
    KeyError: '1'

Tests for the `in` operator::

    >>> 2 in d
    True
    >>> 1 in d
    False

Test for item assignment using non-string key::

    >>> d[0] = 'zero'
    >>> d['0']
    'zero'

Tests for update using a `dict` or a sequence of pairs::

    >>> d.update({6:'six', '8':'eight'})
    >>> sorted(d.keys())
    ['0', '2', '4', '6', '8']
    >>> d.update([(10, 'ten'), ('12', 'twelve')])
    >>> sorted(d.keys())
    ['0', '10', '12', '2', '4', '6', '8']
    >>> d.update([1, 3, 5])
    Traceback (most recent call last):
      ...
    TypeError: 'int' object is not iterable

 N/A collections N/A collections.abc StrKeyDict N/A N/A collections UserDict N/A __init__ N/A N/A self args normalize N/A str kwargs N/A N/A N/A N/A N/A super __init__ self args kwargs N/A N/A self normalize normalize N/A __missing__ N/A N/A self key N/A N/A N/A N/A N/A N/A self normalize key key N/A N/A N/A KeyError key N/A N/A self N/A N/A N/A self normalize key N/A __contains__ N/A N/A self key N/A N/A N/A N/A N/A N/A self normalize key N/A self data N/A __setitem__ N/A N/A self key item N/A N/A N/A N/A N/A self data N/A N/A N/A self normalize key item N/A update N/A N/A self iterable N/A None kwds N/A N/A N/A iterable None N/A N/A N/A isinstance iterable N/A N/A collections abc Mapping N/A N/A pairs N/A N/A iterable items N/A N/A pairs N/A N/A k v N/A N/A k v iterable N/A N/A key value pairs N/A N/A N/A self N/A key value N/A kwds N/A N/A N/A N/A self update kwds N/A N/A