atom.enum

class atom.enum.Enum(*items)[source]

Bases: atom.catom.Member

A member where the value can be one in a sequence of items.

__init__(*items)[source]

Initialize an Enum.

Parameters :

*items :

The allowed values which can be assigned to the enum.

items[source]

A readonly property which returns the items in the enum.

added(*items)[source]

Create a clone of the Enum with added items.

Parameters :

*items :

Additional items to include in the Enum.

Returns :

result : Enum

A new enum object which contains all of the original items plus the new items.

removed(*items)[source]

Create a clone of the Enum with some items removed.

Parameters :

*items :

The items to remove remove from the new enum.

Returns :

result : Enum

A new enum object which contains all of the original items but with the given items removed.

__call__(item)[source]

Create a clone of the Enum item with a new default.

Parameters :

item : object

The item to use as the Enum default. The item must be one of the valid enum items.