Skip to content

attrdict

AttrDict Objects

class AttrDict(object)

A dictionary that can also be accessed by attribute.

__getitem__

def __getitem__(key)

Returns an item.

SparseAttrDict Objects

class SparseAttrDict(AttrDict)

A dictionary that can also be accessed by attribute.

This class never raises IndexError, instead it will return None if a key does not yet exist.

__getitem__

def __getitem__(key)

Returns an item, creating it if it doesn't already exist