MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / resolve

Method resolve

lib/sqlalchemy/orm/decl_api.py:2050–2066  ·  view source on GitHub ↗

Resolve the given python type using the type_annotation_map of the :class:`registry`. :param python_type: a Python type (e.g. ``int``, ``str``, etc.) Any type object that's present in :paramref:`_orm.registry_type_annotation_map` should produce a non-``No

(
        self, python_type: _MatchedOnType
    )

Source from the content-addressed store, hash-verified

2048 self.pep_695_resolved_value = pep_695_resolved_value
2049
2050 def resolve(
2051 self, python_type: _MatchedOnType
2052 ) -> Optional[sqltypes.TypeEngine[Any]]:
2053 """Resolve the given python type using the type_annotation_map of
2054 the :class:`registry`.
2055
2056 :param python_type: a Python type (e.g. ``int``, ``str``, etc.) Any
2057 type object that's present in
2058 :paramref:`_orm.registry_type_annotation_map` should produce a
2059 non-``None`` result.
2060 :return: a SQLAlchemy :class:`.TypeEngine` instance
2061 (e.g. :class:`.Integer`,
2062 :class:`.String`, etc.), or ``None`` to indicate no type could be
2063 matched.
2064
2065 """
2066 return self.registry._resolve_type(python_type)
2067
2068
2069def as_declarative(**kw: Any) -> Callable[[Type[_T]], Type[_T]]:

Callers 2

resolve_custom_typeMethod · 0.45

Calls 1

_resolve_typeMethod · 0.80

Tested by 2

resolve_custom_typeMethod · 0.36