Primitive Types¶
Primitive types are the fundamental building blocks of the pyvider.cty type system. They represent single, atomic values that cannot be decomposed into simpler types.
๐ค AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
The three primitive types are:
- CtyString - Represents text values with Unicode support (NFC normalization)
- CtyNumber - Represents numeric values (integers and decimals) with arbitrary precision using Python's Decimal type
- CtyBool - Represents boolean values (True or False)
Primitive types perform strict validation - they do not perform automatic type coercion. For example, CtyNumber().validate("123") will raise a validation error because the input is a string, not a number. Use the conversion functions if you need flexible type transformation.
See also: User Guide: Primitive Types for detailed usage examples.