全部搜尋項
trixie  ] [  sid  ]
[ 原始碼: python-annotated-types  ]

套件:python3-annotated-types(0.6.0-2)

python3-annotated-types 的相關連結

Screenshot

Debian 的資源:

下載原始碼套件 python-annotated-types

維護小組:

外部的資源:

相似套件:

Reusable constraint types to use with typing.Annotated

Extension to Python's type annotation system, leveraging the capabilities of typing.Annotated to incorporate metadata and constraints directly into type hints. This package facilitates the representation of common constraints such as value bounds (e.g., greater than, less than), length restrictions on collections, and predicates for runtime checks, among others. Designed to enhance the expressiveness and utility of type annotations for both static analysis tools and runtime validation libraries.

Key features:

  - Scalar Value Constraints: Define bounds on scalar values (e.g., integers,
    floats) with Gt, Lt, Ge, Le for greater/less than (or equal to)
    comparisons.
  - Collection Size Constraints: Specify the expected size of collections
    using Len, MinLen, and MaxLen, applicable to any type supporting the len()
    function.
  - Runtime Checks: Utilize the Predicate marker to denote runtime checks,
    enabling custom validation logic within type annotations.
  - Comprehensive Documentation: Annotations can include documentation strings
    via the Doc marker, improving code readability and support for static
    analysis tools.
  - No Runtime Overhead for Checks: While enhancing type annotations with
    meaningful constraints, the package avoids introducing runtime overhead by
    not performing automatic validation checks, preserving performance.

其他與 python3-annotated-types 有關的套件

  • 依賴
  • 推薦
  • 建議
  • 增強

下載 python3-annotated-types

下載可用於所有硬體架構的
硬體架構 套件大小 安裝後大小 檔案
all 16。6 kB55。0 kB [檔案列表]