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비트 정수입니다. ZigZag 인코딩을 사용합니다.
SINT64
- 부호 있는 64비트 정수입니다. ZigZag 인코딩을 사용합니다.
STRING
- UTF-8로 인코딩된 텍스트 문자열입니다.
UINT32
- 부호 없는 32비트 정수입니다.
UINT64
- 부호 없는 64비트 정수입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 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."]]