You are here: Home / LBN / Up2date / Data Science / BastionLinux 36 / python3-annotated-types-0.6.0-1.lbn36.noarch

python3-annotated-types-0.6.0-1.lbn36.noarch

Package Attributes
RPM  python3-annotated-types-0.6.0-1.lbn36.noarch.rpm Architecture  noarch Size  51133 Created  2024/01/21 13:50:03 UTC
Package Specification
Summary Reusable constraint types to use with typing.Annotated
Group Unspecified
License ZPL
Home Page https://pypi.org/project/annotated-types
Description

annotated-types

PEP-593 added typing.Annotated as a way of adding context-specific metadata to existing types, and specifies that Annotated[T, x] should be treated as T by any tool or library without special logic for x. This package provides metadata objects which can be used to represent common constraints such as upper and lower bounds on scalar values and collection sizes, a Predicate marker for runtime checks, and descriptions of how we intend these metadata to be interpreted. In some cases, we also note alternative representations which do not require this package. Install pip install annotated-types

Examples from typing import Annotated from annotated_types import Gt, Len, Predicate

class MyClass: age: Annotated[int, Gt(18)] # Valid: 19, 20, ...

factors: list[Annotated[int, Predicate(is_prime)]] # Valid: 2, 3, 5, 7, 11, ...

Requires
rpmlib(PayloadFilesHavePrefix)  
rpmlib(PayloadIsZstd)  
rpmlib(CompressedFileNames)  
rpmlib(PartialHardlinkSets)  
rpmlib(FileDigests)  
Provides
python-annotated-types
python3-annotated-types
python3.10-annotated-types
python3.10dist(annotated-types)
python3dist(annotated-types)
Obsoletes
python-annotated-types

Document Actions