MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _shallow_annotate

Function _shallow_annotate

lib/sqlalchemy/sql/annotation.py:522–532  ·  view source on GitHub ↗

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.

(element: _SA, annotations: _AnnotationDict)

Source from the content-addressed store, hash-verified

520
521
522def _shallow_annotate(element: _SA, annotations: _AnnotationDict) -> _SA:
523 """Annotate the given ClauseElement and copy its internals so that
524 internal objects refer to the new annotated object.
525
526 Basically used to apply a "don't traverse" annotation to a
527 selectable, without digging throughout the whole
528 structure wasting time.
529 """
530 element = element._annotate(annotations)
531 element._copy_internals(_annotations_traversal=True)
532 return element
533
534
535def _new_annotation_type(

Callers 1

join_targetsMethod · 0.85

Calls 2

_annotateMethod · 0.45
_copy_internalsMethod · 0.45

Tested by

no test coverage detected