List[Any], # MD_OBJECTS
str, # MD_LOOKUP_KEY
str, # MD_RENDERED_NAME
- Optional["_ResultProcessorType"], # MD_PROCESSOR
+ Optional["_ResultProcessorType[Any]"], # MD_PROCESSOR
Optional[str], # MD_UNTRANSLATED
]
List[Any],
str,
str,
- Optional["_ResultProcessorType"],
+ Optional["_ResultProcessorType[Any]"],
str,
]
metadata = self._init_metadata(context, cursor_description)
+ _make_row: Any
_make_row = functools.partial(
Row,
metadata,
_KeyMapType = Mapping[_KeyType, _KeyMapRecType]
-_RowData = Union[Row, RowMapping, Any]
+_RowData = Union[Row[Any], RowMapping, Any]
"""A generic form of "row" that accommodates for the different kinds of
"rows" that different result objects return, including row, row mapping, and
scalar values"""
"""
-_InterimSupportsScalarsRowType = Union[Row, Any]
+_InterimSupportsScalarsRowType = Union[Row[Any], Any]
_ProcessorsType = Sequence[Optional["_ResultProcessorType[Any]"]]
_TupleGetterType = Callable[[Sequence[Any]], Sequence[Any]]
def __init__(
self, mapping: Mapping["_KeyType", Any], items: Sequence[Any]
):
- self._mapping = mapping
- self._items = items
+ self._mapping = mapping # type: ignore[misc]
+ self._items = items # type: ignore[misc]
def __len__(self) -> int:
return len(self._items)
class ROMappingKeysValuesView(
ROMappingView, typing.KeysView["_KeyType"], typing.ValuesView[Any]
):
- __slots__ = ("_items",)
+ __slots__ = ("_items",) # mapping slot is provided by KeysView
class ROMappingItemsView(ROMappingView, typing.ItemsView["_KeyType", Any]):
- __slots__ = ("_items",)
+ __slots__ = ("_items",) # mapping slot is provided by ItemsView
class RowMapping(BaseRow, typing.Mapping["_KeyType", Any]):
defaults = {}
for item in field_list:
if len(item) == 2:
- name, tp = item # type: ignore
+ name, tp = item
elif len(item) == 3:
- name, tp, spec = item # type: ignore
+ name, tp, spec = item
defaults[name] = spec
else:
assert False
self._adapt_to_entity = adapt_to_entity
@util.non_memoized_property
- def property(self) -> MapperProperty[_T]:
+ def property(self) -> MapperProperty[_T_co]:
"""Return the :class:`.MapperProperty` associated with this
:class:`.PropComparator`.
def adapt_to_entity(
self, adapt_to_entity: AliasedInsp[Any]
- ) -> PropComparator[_T]:
+ ) -> PropComparator[_T_co]:
"""Return a copy of this PropComparator which will use the given
:class:`.AliasedInsp` to produce corresponding expressions.
"""
) -> ColumnElement[Any]:
...
- def of_type(self, class_: _EntityType[Any]) -> PropComparator[_T]:
+ def of_type(self, class_: _EntityType[Any]) -> PropComparator[_T_co]:
r"""Redefine this object in terms of a polymorphic subclass,
:func:`_orm.with_polymorphic` construct, or :func:`_orm.aliased`
construct.
def __or__( # type: ignore[override]
self, __value: Mapping[_KT, _VT]
) -> immutabledict[_KT, _VT]:
- return immutabledict(super().__or__(__value))
+ return immutabledict(
+ super().__or__(__value), # type: ignore[call-overload]
+ )
def __ror__( # type: ignore[override]
self, __value: Mapping[_KT, _VT]
) -> immutabledict[_KT, _VT]:
- return immutabledict(super().__ror__(__value))
+ return immutabledict(
+ super().__ror__(__value), # type: ignore[call-overload]
+ )
class OrderedSet(Set[_T]):
def importlib_metadata_get(group):
ep = importlib_metadata.entry_points()
- if not typing.TYPE_CHECKING and hasattr(ep, "select"):
+ if hasattr(ep, "select"):
return ep.select(group=group)
else:
return ep.get(group, ())