blpapi.ConstantList

class blpapi.ConstantList

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__()
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 or str) – Name of the constant

Returns

Constant with the specified name

Return type

Constant

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

Returns

Constant at the specified position.

Return type

Constant

Raises

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

hasConstant(name)
Parameters

name (Name or str) – Name of the constant

Returns

True if this ConstantList contains an item with this name.

Return type

bool

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