Coverage for sources/classcore/standard/nomina.py: 100%
25 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-29 23:23 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-29 23:23 +0000
1# vim: set filetype=python fileencoding=utf-8:
2# -*- coding: utf-8 -*-
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#============================================================================#
21''' Catalog of common type aliases. '''
22# ruff: noqa: F403,F405
25from __future__ import annotations
27from . import __
28from ..nomina import *
31BehaviorExclusionNames: __.typx.TypeAlias = __.cabc.Set[ str ]
32BehaviorExclusionNamesOmni: __.typx.TypeAlias = (
33 BehaviorExclusionNames | __.typx.Literal[ '*' ] )
34BehaviorExclusionPredicate: __.typx.TypeAlias = (
35 __.cabc.Callable[ [ str ], bool ] )
36BehaviorExclusionPredicates: __.typx.TypeAlias = (
37 __.cabc.Sequence[ BehaviorExclusionPredicate ] )
38BehaviorExclusionRegex: __.typx.TypeAlias = __.re.Pattern[ str ]
39BehaviorExclusionRegexes: __.typx.TypeAlias = (
40 __.cabc.Sequence[ BehaviorExclusionRegex ] )
41BehaviorExclusionVerifier: __.typx.TypeAlias = (
42 str | BehaviorExclusionRegex | BehaviorExclusionPredicate )
43BehaviorExclusionVerifiers: __.typx.TypeAlias = (
44 __.cabc.Sequence[ BehaviorExclusionVerifier ] )
45BehaviorExclusionVerifiersOmni: __.typx.TypeAlias = (
46 BehaviorExclusionVerifiers | __.typx.Literal[ '*' ] )
47ErrorClassProvider: __.typx.TypeAlias = (
48 __.cabc.Callable[ [ str ], type[ Exception ] ] )
51class AssignerCore( __.typx.Protocol ):
52 ''' Core implementation of attributes assigner. '''
54 @staticmethod
55 def __call__( # noqa: PLR0913 # pragma: no branch
56 obj: object, /, *,
57 ligation: AssignerLigation,
58 attributes_namer: AttributesNamer,
59 error_class_provider: ErrorClassProvider,
60 level: str,
61 name: str,
62 value: __.typx.Any,
63 ) -> None: raise NotImplementedError
66class DeleterCore( __.typx.Protocol ):
67 ''' Core implementation of attributes deleter. '''
69 @staticmethod
70 def __call__( # noqa: PLR0913 # pragma: no branch
71 obj: object, /, *,
72 ligation: DeleterLigation,
73 attributes_namer: AttributesNamer,
74 error_class_provider: ErrorClassProvider,
75 level: str,
76 name: str,
77 ) -> None: raise NotImplementedError
80class SurveyorCore( __.typx.Protocol ):
81 ''' Core implementation of attributes surveyor. '''
83 @staticmethod
84 def __call__( # pragma: no branch
85 obj: object, /, *,
86 ligation: SurveyorLigation,
87 attributes_namer: AttributesNamer,
88 level: str,
89 ) -> __.cabc.Iterable[ str ]: raise NotImplementedError
92class ClassPreparer( __.typx.Protocol ):
93 ''' Prepares class for decorator application. '''
95 @staticmethod
96 def __call__( # pragma: no branch
97 class_: type,
98 decorators: DecoratorsMutable, /, *,
99 attributes_namer: AttributesNamer,
100 ) -> None: raise NotImplementedError