atom.list

class atom.list.List(item=None, default=None)[source]

Bases: atom.catom.Member

A member which allows list values.

Assigning to a list creates a copy. The orginal list will remain unmodified. This is similar to the semantics of the assignment operator on the C++ STL container classes.

__init__(item=None, default=None)[source]

Initialize a List.

Parameters :

item : Member, type, or tuple of types, optional

A member to use for validating the types of items allowed in the list. This can also be a type object or a tuple of types, in which case it will be wrapped with an Instance member. If this is not given, no item validation is performed.

default : list, optional

The default list of values. A new copy of this list will be created for each atom instance.

set_name(name)[source]

Set the name of the member.

This method ensures that the item member name is also updated.

set_index(index)[source]

Assign the index to this member.

This method ensures that the item member index is also updated.

clone()[source]

Create a clone of the list.

This will clone the internal list item if one is in use.