atom.dict

class atom.dict.Dict(key=None, value=None, default=None)[source]

Bases: atom.catom.Member

A value of type dict.

__init__(key=None, value=None, default=None)[source]

Initialize a Dict.

Parameters :

key : Member, type, tuple of types, or None, optional

A member to use for validating the types of keys allowed in the dict. This can also be a type or a tuple of types, which will be wrapped with an Instance member. If this is not given, no key validation is performed.

value : Member, type, tuple of types, or None, optional

A member to use for validating the types of values allowed in the dict. This can also be a type or a tuple of types, which will be wrapped with an Instance member. If this is not given, no value validation is performed.

default : dict, optional

The default dict of items. A new copy of this dict will be created for each atom instance.

post_getattr(owner, data)[source]

A post getattr handler.

If the dict performs key or value validation, then this handler will be called to wrap the dict in a proxy object on the fly.

set_name(name)[source]

Assign the name to this member.

This method is called by the Atom metaclass when a class is created. This makes sure the name of the internal members are also updated.

set_index(index)[source]

Assign the index to this member.

This method is called by the Atom metaclass when a class is created. This makes sure the index of the internal members are also updated.