blpapi.ConstantList

class blpapi.ConstantList(handle, sessions)

Represents a list of schema enumeration constants.

As well as the list of Constant objects, this class also provides access to the symbolic name, description and status of the list as a whole. All Constant objects in a ConstantList are of the same DataType.

ConstantList objects are read-only.

Application clients never create ConstantList object directly; applications will typically work with ConstantList objects returned by other blpapi components.

__iter__()
Return type:

Iterator

Returns:

Iterator over constants contained in this ConstantList

datatype()
Returns:

Data type used to represent the value of this constant

Return type:

int

The possible return values are enumerated in DataType.

description()
Returns:

Human readable description of this ConstantList

Return type:

str

getConstant(name)
Parameters:

name (Name) – Name of the constant

Return type:

Constant

Returns:

Constant with the specified name

Raises:

NotFoundException – If this ConstantList does not contain a Constant with the specified name

getConstantAt(position)
Parameters:

position (int) – Position of the requested constant in the list

Return type:

Constant

Returns:

Constant at the specified position.

Raises:

IndexOutOfRangeException – If position is not in the range from 0 to numConstants() - 1.

hasConstant(name)
Parameters:

name (Name) – Name of the constant

Return type:

bool

Returns:

True if this ConstantList contains an item with this name.

Raises:

TypeError – If name is neither a Name nor a string

name()
Returns:

Symbolic name of this ConstantList

Return type:

Name

numConstants()
Returns:

Number of Constant objects in this list

Return type:

int

status()
Returns:

Status of this ConstantList

Return type:

int

The possible return values are enumerated in SchemaStatus