MCPcopy Index your code
hub / github.com/fastapi/sqlmodel / get_annotations

Function get_annotations

sqlmodel/_compat.py:100–112  ·  view source on GitHub ↗
(class_dict: dict[str, Any])

Source from the content-addressed store, hash-verified

98
99
100def get_annotations(class_dict: dict[str, Any]) -> dict[str, Any]:
101 raw_annotations: dict[str, Any] = class_dict.get("__annotations__", {})
102 if sys.version_info >= (3, 14) and "__annotations__" not in class_dict:
103 # See https://github.com/pydantic/pydantic/pull/11991
104 from annotationlib import (
105 Format,
106 call_annotate_function,
107 get_annotate_from_class_namespace,
108 )
109
110 if annotate := get_annotate_from_class_namespace(class_dict):
111 raw_annotations = call_annotate_function(annotate, format=Format.FORWARDREF)
112 return raw_annotations
113
114
115def is_table_model_class(cls: type[Any]) -> bool:

Callers 1

__new__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…