MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / is_pep695

Function is_pep695

lib/sqlalchemy/util/typing.py:341–350  ·  view source on GitHub ↗
(type_: _AnnotationScanType)

Source from the content-addressed store, hash-verified

339
340
341def is_pep695(type_: _AnnotationScanType) -> TypeGuard[TypeAliasType]:
342 # NOTE: a generic TAT does not instance check as TypeAliasType outside of
343 # python 3.10. For sqlalchemy use cases it's fine to consider it a TAT
344 # though.
345 # NOTE: things seems to work also without this additional check
346 if is_generic(type_):
347 if is_pep593(type_):
348 return False
349 return is_pep695(type_.__origin__)
350 return isinstance(type_, _type_instances.TypeAliasType)
351
352
353def pep695_values(type_: _AnnotationScanType) -> Set[Any]:

Callers 4

recursive_valueFunction · 0.85
includes_noneFunction · 0.85

Calls 2

is_genericFunction · 0.85
is_pep593Function · 0.85

Tested by

no test coverage detected