Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



The Enum Class

The Enum class is the base class for all enumerated types, used to initialize new Enum instances.

Enum is provided by the protorpc.messages module.

  1. Enum()
  2. Class Methods

Constructor

The constructor of the EnumField class is defined as follows:

class Enum ( name , number = None )

Initializes an Enum instance automatically when the class is constructed. Integers and strings are cast automatically to the enum values.

Arguments

name
The name of the Enum instance to initialize.
number
The number of the Enum instance to initialize.

Raises an exception if called on a class that has already been initialized.

Class Methods

The Enum class provides the following class methods:

to_dict ()
Makes a dictionary version of enumerated class. You can use this dictionary with def_num and import_enum.
Returns a dictionary name and number for the enumerated class.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.