diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-01-30 15:12:52 -0500 |
---|---|---|
committer | mike bayer <mike_mp@zzzcomputing.com> | 2023-01-31 19:13:16 +0000 |
commit | a21c715b7a89b0619db0d2d5b31617d17b25a27a (patch) | |
tree | 01971eece9c687570137dd6e5d8e86b6040b697c /lib/sqlalchemy/orm/decl_base.py | |
parent | 6d6a17240815b9090a2972607657f93d347167d6 (diff) | |
download | sqlalchemy-a21c715b7a89b0619db0d2d5b31617d17b25a27a.tar.gz |
support NewType in type_annotation_map
Added support for :pep:`484` ``NewType`` to be used in the
:paramref:`_orm.registry.type_annotation_map` as well as within
:class:`.Mapped` constructs. These types will behave in the same way as
custom subclasses of types right now; they must appear explicitly within
the :paramref:`_orm.registry.type_annotation_map` to be mapped.
Within this change, the lookup between decl_api._resolve_type
and TypeEngine._resolve_for_python_type is streamlined to not
inspect the given type multiple times, instead passing
in from decl_api to TypeEngine the already "flattened" version
of a Generic or NewType type.
Fixes: #9175
Change-Id: I227cf84b4b88e4567fa2d1d7da0c05b54e00c562
Diffstat (limited to 'lib/sqlalchemy/orm/decl_base.py')
0 files changed, 0 insertions, 0 deletions