The traits.api.Tuple is a class from the Python Traits library that allows the definition of a trait for storing a tuple of values. This trait can be used to define an attribute in a class, specifying the expected data type to be a tuple. The Tuple trait provides validation and coercion features, ensuring that the assigned value is a tuple, and if requested, ensuring that the tuple has a specific length or contains elements of a certain type. Additionally, it supports default values and enables the creation of read-only or constant tuples.
Python Tuple - 30 examples found. These are the top rated real world Python examples of traits.api.Tuple extracted from open source projects. You can rate examples to help us improve the quality of examples.