Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products. If you have feedback or questions as you navigate the site, click Send Feedback.

Python 2 is no longer supported by the community. We recommend that you migrate Python 2 apps to Python 3.

The Variant Class

Stay organized with collections Save and categorize content based on your preferences.

The protobuf wire format uses the Variant class to determine how to transmit a single piece of data. May be used by other formats; see Protocol Buffers Encoding for more information.

Variant is provided by the protorpc.messages module.

Variant has the following values:

BOOL
Boolean value (True or False)
BYTES
String of 8-bit bytes.
DOUBLE
64-bit floating point number.
ENUM
Enum value (an integer).
FLOAT
32-bit floating point number.
INT32
32-bit signed integer.
INT64
64-bit signed integer.
MESSAGE
Embedded message as byte string.
SINT32
32-bit signed integer. Uses ZigZag encoding.
SINT64
64-bit signed integer. Uses ZigZag encoding.
STRING
String of UTF-8-encoded text.
UINT32
32-bit unsigned integer.
UINT64
64-bit unsigned integer.