Coverage for structured_tutorials / typing.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2025-12-23 20:20 +0100

1# Copyright (c) 2025 Mathias Ertl 

2# Licensed under the MIT License. See LICENSE file for details. 

3 

4"""Module that re-exports some type hints.""" 

5 

6from typing import Annotated 

7 

8from pydantic import AfterValidator, NonNegativeInt 

9 

10from structured_tutorials.models.validators import validate_count_tuple 

11 

12try: 

13 from typing import Self 

14except ImportError: # pragma: no cover 

15 # Note: only for py3.10 

16 from typing_extensions import Self 

17 

18COUNT_TUPLE = Annotated[ 

19 tuple[NonNegativeInt | None, NonNegativeInt | None], AfterValidator(validate_count_tuple) 

20] 

21COUNT_TYPE = NonNegativeInt | COUNT_TUPLE | None 

22 

23__all__ = [ 

24 "COUNT_TYPE", 

25 "Self", 

26]