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