pycocoa.dicts.Dict

Package pycocoa :: Module dicts :: Class Dict |
[frames] | no frames]

# Class Dict

              object --+
                       |
    internals._Objectype --+
                           |
            baseTypes._Type0 --+
                               |
                 _FrozenDictBase --+
                                   |
                          FrozenDict --+
                                       |
                                      Dict

Python `dict` Type, wrapping an ObjC `NSMutableDictionary`.

Instance Methods
__iter__(self) Yield the keys, like `dict.keys`. |
__init__(self, *ns_dict, **kwds) New mutable Dict, like `dict.__init__`. |
__delitem__(self, key) Remove an item, like `dict.__delitem__`. |
__setitem__(self, key, value) |
clear(self) Remove all items, like `dict.clear`. |
copy(self) Make a shallow copy. |
pop(self, key, default=missing) Remove an item, like `dict.pop`. |
setdefault(self, key, default=missing) Get/set an item, like `dict.setdefault`, except the default keyword is required for a new key. |
update(self, *other, **kwds) Update, like `dict.update`, except other must be a `dict`, Dict or FrozenDict. |
Inherited from `FrozenDict`: `__contains__`, `__eq__`, `__getitem__`, `__len__`, `__ne__`, `get`, `items`, `keys`, `values` Inherited from `_FrozenDictBase`: `__call__`, `popitem` Inherited from `baseTypes._Type0`: `__repr__`, `__str__`, `type2strepr` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
Inherited from `baseTypes._Type0`: `NS`, `NSDelegate` Inherited from `internals._Objectype`: `typename` Inherited from `object`: `__class__`

Method Details

### __iter__(self) |
Yield the keys, like `dict.keys`. Overrides: FrozenDict.keys

### __init__(self, *ns_dict, **kwds) (Constructor) |
New mutable Dict, like `dict.__init__`. Overrides: object.__init__

### __delitem__(self, key) (Index deletion operator) |
Remove an item, like `dict.__delitem__`. Raises: `KeyError` - No such key. Overrides: _FrozenDictBase.__delitem__

### __setitem__(self, key, value) (Index assignment operator) |
Overrides: _FrozenDictBase.__setitem__

### clear(self) |
Remove all items, like `dict.clear`. Overrides: _FrozenDictBase.clear

### copy(self) |
Make a shallow copy. Returns: The copy (Dict). Overrides: FrozenDict.copy

### pop(self, key, default=missing) |
Remove an item, like `dict.pop`. Raises: `KeyError` - No such key and no default provided. Overrides: _FrozenDictBase.pop

### setdefault(self, key, default=missing) |
Get/set an item, like `dict.setdefault`, except the default keyword is required for a new key. Raises: `ValueError` - No default provided for new key. Overrides: _FrozenDictBase.setdefault

### update(self, *other, **kwds) |
Update, like `dict.update`, except other must be a `dict`, Dict or FrozenDict. Raises: `TypeError` - Invalid type of other. Overrides: _FrozenDictBase.update See Also: <https://Docs.Python.org/3/library/stdtypes.html#dict.update>