MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / recursive_value

Function recursive_value

lib/sqlalchemy/util/typing.py:362–373  ·  view source on GitHub ↗
(inner_type)

Source from the content-addressed store, hash-verified

360 _seen = set()
361
362 def recursive_value(inner_type):
363 if inner_type in _seen:
364 # recursion are not supported (at least it's flagged as
365 # an error by pyright). Just avoid infinite loop
366 return inner_type
367 _seen.add(inner_type)
368 if not is_pep695(inner_type):
369 return inner_type
370 value = inner_type.__value__
371 if not is_union(value):
372 return value
373 return [recursive_value(t) for t in value.__args__]
374
375 res = recursive_value(type_)
376 if isinstance(res, list):

Callers 1

pep695_valuesFunction · 0.85

Calls 3

is_pep695Function · 0.85
is_unionFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected