diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2023-04-25 17:23:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2023-04-25 17:23:33 +0000 |
commit | 9f675fd042b05977f1b38887c2fbbb54ecd424f7 (patch) | |
tree | e82af5ea512b8e015928e8bb721282eb5afd194d /lib/sqlalchemy/engine/row.py | |
parent | 040e0d2560c17ff490b2b0bbe193c7658d3b4603 (diff) | |
parent | c1125288e3c413d868070995b308085d2ddf402e (diff) | |
download | sqlalchemy-9f675fd042b05977f1b38887c2fbbb54ecd424f7.tar.gz |
Merge "Fix `RowMapping`'s `Mapping` type to reflect that it supports `Column`s or strings" into main
Diffstat (limited to 'lib/sqlalchemy/engine/row.py')
-rw-r--r-- | lib/sqlalchemy/engine/row.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/sqlalchemy/engine/row.py b/lib/sqlalchemy/engine/row.py index e2690ac2d..e15ea7b17 100644 --- a/lib/sqlalchemy/engine/row.py +++ b/lib/sqlalchemy/engine/row.py @@ -271,9 +271,11 @@ class ROMappingView(ABC): __slots__ = () _items: Sequence[Any] - _mapping: Mapping[str, Any] + _mapping: Mapping["_KeyType", Any] - def __init__(self, mapping: Mapping[str, Any], items: Sequence[Any]): + def __init__( + self, mapping: Mapping["_KeyType", Any], items: Sequence[Any] + ): self._mapping = mapping self._items = items @@ -297,16 +299,16 @@ class ROMappingView(ABC): class ROMappingKeysValuesView( - ROMappingView, typing.KeysView[str], typing.ValuesView[Any] + ROMappingView, typing.KeysView["_KeyType"], typing.ValuesView[Any] ): __slots__ = ("_items",) -class ROMappingItemsView(ROMappingView, typing.ItemsView[str, Any]): +class ROMappingItemsView(ROMappingView, typing.ItemsView["_KeyType", Any]): __slots__ = ("_items",) -class RowMapping(BaseRow, typing.Mapping[str, Any]): +class RowMapping(BaseRow, typing.Mapping["_KeyType", Any]): """A ``Mapping`` that maps column names and objects to :class:`.Row` values. |