MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _copy_generic_annotation_with

Function _copy_generic_annotation_with

lib/sqlalchemy/util/typing.py:229–237  ·  view source on GitHub ↗
(
    annotation: GenericProtocol[_T], elements: Tuple[_AnnotationScanType, ...]
)

Source from the content-addressed store, hash-verified

227
228
229def _copy_generic_annotation_with(
230 annotation: GenericProtocol[_T], elements: Tuple[_AnnotationScanType, ...]
231) -> Type[_T]:
232 if hasattr(annotation, "copy_with"):
233 # List, Dict, etc. real generics
234 return annotation.copy_with(elements) # type: ignore
235 else:
236 # Python builtins list, dict, etc.
237 return annotation.__origin__[elements] # type: ignore
238
239
240def eval_expression(

Callers 1

de_stringify_annotationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected