Coverage for sources/ictruck/__/imports.py: 100%

28 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-04-07 00:37 +0000

1# vim: set filetype=python fileencoding=utf-8: 

2# -*- coding: utf-8 -*- 

3 

4#============================================================================# 

5# # 

6# Licensed under the Apache License, Version 2.0 (the "License"); # 

7# you may not use this file except in compliance with the License. # 

8# You may obtain a copy of the License at # 

9# # 

10# http://www.apache.org/licenses/LICENSE-2.0 # 

11# # 

12# Unless required by applicable law or agreed to in writing, software # 

13# distributed under the License is distributed on an "AS IS" BASIS, # 

14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # 

15# See the License for the specific language governing permissions and # 

16# limitations under the License. # 

17# # 

18#============================================================================# 

19 

20 

21''' Common imports and type aliases used throughout the package. ''' 

22 

23# ruff: noqa: F401 

24 

25 

26from __future__ import annotations 

27 

28import collections.abc as cabc 

29import contextlib as ctxl 

30import dataclasses as dcls 

31import enum 

32import functools as funct 

33import inspect 

34import io 

35import itertools as itert 

36import locale 

37import os 

38import re 

39import sys 

40import threading as threads 

41import time 

42import types 

43import warnings 

44 

45import typing_extensions as typx 

46# --- BEGIN: Injected by Copier --- 

47# --- END: Injected by Copier --- 

48 

49from absence import Absential, absent, is_absent 

50from accretive.qaliases import AccretiveDictionary 

51from frigid.qaliases import ( 

52 ImmutableClass, 

53 ImmutableCompleteDataclass, 

54 ImmutableDictionary, 

55 immutable, 

56 reclassify_modules_as_immutable, 

57) 

58 

59 

60H = typx.TypeVar( 'H', bound = cabc.Hashable ) # Hash Key 

61V = typx.TypeVar( 'V' ) # Value 

62 

63 

64ComparisonResult: typx.TypeAlias = bool | types.NotImplementedType 

65DictionaryNominativeArgument: typx.TypeAlias = typx.Annotated[ 

66 V, 

67 typx.Doc( 

68 'Zero or more keyword arguments from which to initialize ' 

69 'dictionary data.' ), 

70] 

71DictionaryPositionalArgument: typx.TypeAlias = typx.Annotated[ 

72 cabc.Mapping[ H, V ] | cabc.Iterable[ tuple[ H, V ] ], 

73 typx.Doc( 

74 'Zero or more iterables from which to initialize dictionary data. ' 

75 'Each iterable must be dictionary or sequence of key-value pairs. ' 

76 'Duplicate keys will result in an error.' ), 

77] 

78ExceptionInfo: typx.TypeAlias = tuple[ 

79 type[ BaseException ] | None, 

80 BaseException | None, 

81 types.TracebackType | None ] 

82 

83package_name = __name__.split( '.', maxsplit = 1 )[ 0 ]