class Annotated(SupportsAnnotations): (source)
Known subclasses: sqlalchemy.sql.elements.AnnotatedColumnElement
, sqlalchemy.sql.selectable.AnnotatedFromClause
clones a SupportsAnnotations and applies an 'annotations' dictionary. Unlike regular clones, this clone also mimics __hash__() and __eq__() of the original element so that it takes its place in hashed collections. A reference to the original element is maintained, for the important reason of keeping its hash value current. When GC'ed, the hash value may be reused, causing conflicts. .. note:: The rationale for Annotated producing a brand new class, rather than placing the functionality directly within ClauseElement, is **performance**. The __hash__() method is absent on plain ClauseElement which leads to significantly reduced function call overhead, as the use of sets and dictionaries against ClauseElement objects is prevalent, but most are not "annotated".
Method | __eq__ |
Undocumented |
Method | __hash__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __new__ |
Undocumented |
Method | __reduce__ |
Undocumented |
Instance Variable | __dict__ |
Undocumented |
Property | entity |
Undocumented |
Class Method | _as |
Undocumented |
Method | _annotate |
Undocumented |
Method | _clone |
clone this element |
Method | _compiler |
Undocumented |
Method | _deannotate |
Undocumented |
Method | _with |
Undocumented |
Class Variable | _is |
Undocumented |
Instance Variable | __element |
Undocumented |
Instance Variable | _annotations |
Undocumented |
Instance Variable | _hash |
Undocumented |
Property | _constructor |
Undocumented |
Inherited from SupportsAnnotations
:
Class Variable | __slots__ |
Undocumented |
Class Variable | proxy |
Undocumented |
Method | _gen |
Undocumented |
Class Variable | _is |
Undocumented |
Property | _annotations |
Undocumented |
Inherited from ExternallyTraversible
(via SupportsAnnotations
):
Method | get |
Return immediate child :class:`.visitors.HasTraverseInternals` elements of this :class:`.visitors.HasTraverseInternals`. |
Method | _copy |
Reassign internal elements to be clones of themselves. |
Inherited from HasTraverseInternals
(via SupportsAnnotations
, ExternallyTraversible
):
Class Variable | _traverse |
Undocumented |
Inherited from Visitable
(via SupportsAnnotations
, ExternallyTraversible
, HasTraverseInternals
):
Method | __class |
Undocumented |
Method | __init |
Undocumented |
Class Variable | __visit |
Undocumented |
Class Method | _generate |
Undocumented |
Class Variable | _original |
Undocumented |
def _as_annotated_instance(cls, element:
SupportsWrappingAnnotations
, values: _AnnotationDict
) -> Annotated
:
(source)
¶
Undocumented