Python 2.7 はサポートが終了しており、2026 年 1 月 31 日に
非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、Python 2.7 アプリケーションをデプロイできなくなります。既存の Python 2.7 アプリケーションは、
非推奨日以降も引き続き実行され、トラフィックを受信します。
サポートされている最新バージョンの Python に移行することをおすすめします。
Variant クラス
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
protobuf
転送形式では、Variant クラスを使用して単一のデータを転送する方法を判断します。他の形式で使用する場合もあります。詳しくは、プロトコル バッファ エンコードをご覧ください。
Variant
は protorpc.messages
モジュールによって提供されます。
Variant には次の値があります。
BOOL
- ブール値(True または False)。
BYTES
- 8 ビットバイトの文字列。
DOUBLE
- 64 ビット浮動小数点数。
ENUM
- 列挙値(整数)。
FLOAT
- 32 ビット浮動小数点数。
INT32
- 32 ビット符号付き整数。
INT64
- 64 ビット符号付き整数。
MESSAGE
- バイト文字列としての埋め込みメッセージ。
SINT32
- 32 ビット符号付き整数。ジグザグ エンコードを使用します。
SINT64
- 64 ビット符号付き整数。ジグザグ エンコードを使用します。
STRING
- UTF-8 でエンコードされたテキストの文字列。
UINT32
- 32 ビット符号なし整数。
UINT64
- 64 ビット符号なし整数。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-04 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eThe \u003ccode\u003eprotobuf\u003c/code\u003e wire format utilizes the \u003ccode\u003eVariant\u003c/code\u003e class to define data transmission.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eVariant\u003c/code\u003e, found in the \u003ccode\u003eprotorpc.messages\u003c/code\u003e module, specifies the type of data being transmitted.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eVariant\u003c/code\u003e supports various data types, including boolean, byte strings, floating-point numbers, enums, integers, and embedded messages.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eVariant\u003c/code\u003e can utilize ZigZag encoding for signed integers using \u003ccode\u003eSINT32\u003c/code\u003e and \u003ccode\u003eSINT64\u003c/code\u003e types.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSTRING\u003c/code\u003e type is used for UTF-8 encoded text.\u003c/p\u003e\n"]]],[],null,["# The Variant Class\n\nThe `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](https://developers.google.com/protocol-buffers/docs/encoding) for more information.\n\n`Variant` is provided by the `protorpc.messages` module.\n\nVariant has the following values:\n\n`BOOL`\n: Boolean value (True or False)\n\n`BYTES`\n: String of 8-bit bytes.\n\n`DOUBLE`\n: 64-bit floating point number.\n\n`ENUM`\n: Enum value (an integer).\n\n`FLOAT`\n: 32-bit floating point number.\n\n`INT32`\n: 32-bit signed integer.\n\n`INT64`\n: 64-bit signed integer.\n\n`MESSAGE`\n: Embedded message as byte string.\n\n`SINT32`\n: 32-bit signed integer. Uses [ZigZag encoding](https://developers.google.com/protocol-buffers/docs/encoding#types).\n\n`SINT64`\n: 64-bit signed integer. Uses [ZigZag encoding](https://developers.google.com/protocol-buffers/docs/encoding#types).\n\n`STRING`\n: String of UTF-8-encoded text.\n\n`UINT32`\n: 32-bit unsigned integer.\n\n`UINT64`\n: 64-bit unsigned integer."]]