module documentation

The :class:`.Annotated` class and related routines; creates hash-equivalent copies of SQL constructs which contain context-specific markers and associations. Note that the :class:`.Annotated` concept as implemented in this module is not related in any way to the pep-593 concept of "Annotated".

Class Annotated clones a SupportsAnnotations and applies an 'annotations' dictionary.
Class SupportsAnnotations Undocumented
Class SupportsCloneAnnotations No class docstring; 0/2 class variable, 3/3 methods documented
Class SupportsWrappingAnnotations No class docstring; 0/1 property, 0/2 class variable, 3/3 methods documented
Variable annotated_classes Undocumented
Function _deep_annotate Deep copy the given ClauseElement, annotating each element with the given annotations dictionary.
Function _deep_deannotate Deep copy the given element, removing annotations.
Function _new_annotation_type Generates a new class that subclasses Annotated and proxies a given element type.
Function _prepare_annotations Undocumented
Function _shallow_annotate Annotate the given ClauseElement and copy its internals so that internal objects refer to the new annotated object.
Type Variable _SA Undocumented
Type Alias _AnnotationDict Undocumented
def _deep_annotate(element: _SA, annotations: _AnnotationDict, exclude: Optional[Sequence[SupportsAnnotations]] = None, detect_subquery_cols: bool = False, ind_cols_on_fromclause: bool = False) -> _SA: (source)

Deep copy the given ClauseElement, annotating each element with the given annotations dictionary. Elements within the exclude collection will be cloned but not annotated.

@overload
def _deep_deannotate(element: Literal[None], values: Optional[Sequence[str]] = None) -> Literal[None]:
@overload
def _deep_deannotate(element: _SA, values: Optional[Sequence[str]] = None) -> _SA:
(source)

Deep copy the given element, removing annotations.

def _new_annotation_type(cls: Type[SupportsWrappingAnnotations], base_cls: Type[Annotated]) -> Type[Annotated]: (source)

Generates a new class that subclasses Annotated and proxies a given element type.

def _prepare_annotations(target_hierarchy: Type[SupportsWrappingAnnotations], base_cls: Type[Annotated]): (source)

Undocumented

def _shallow_annotate(element: _SA, annotations: _AnnotationDict) -> _SA: (source)

Annotate the given ClauseElement and copy its internals so that internal objects refer to the new annotated object. Basically used to apply a "don't traverse" annotation to a selectable, without digging throughout the whole structure wasting time.

Undocumented

Value
TypeVar('_SA',
        bound='SupportsAnnotations')
_AnnotationDict = (source)

Undocumented

Value
Mapping[str, Any]