diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-02-27 23:05:46 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-01 21:05:14 -0500 |
| commit | afb9634fb28b00c7b0979660e3e0bfed6caafde5 (patch) | |
| tree | 11afb462226f64d922f9d3c425a7d2c09c3d69d7 /lib/sqlalchemy/orm/collections.py | |
| parent | 7f1a3f22abffc1529100e14fcfd07a46a49fd44f (diff) | |
| download | sqlalchemy-afb9634fb28b00c7b0979660e3e0bfed6caafde5.tar.gz | |
pep484 + abc bases for assocaitionproxy
went to this one next as it was going to be hard,
and also exercises the ORM expression hierarchy a bit.
made some adjustments to SQLCoreOperations etc.
Change-Id: Ie5dde9218dc1318252826b766d3e70b17dd24ea7
References: #6810
References: #7774
Diffstat (limited to 'lib/sqlalchemy/orm/collections.py')
| -rw-r--r-- | lib/sqlalchemy/orm/collections.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/collections.py b/lib/sqlalchemy/orm/collections.py index 00ae9dac7..b1854de5a 100644 --- a/lib/sqlalchemy/orm/collections.py +++ b/lib/sqlalchemy/orm/collections.py @@ -107,6 +107,7 @@ from __future__ import annotations import operator import threading import typing +from typing import Any import weakref from .. import exc as sa_exc @@ -1239,13 +1240,13 @@ def _dict_decorators(): _set_binop_bases = (set, frozenset) -def _set_binops_check_strict(self, obj): +def _set_binops_check_strict(self: Any, obj: Any) -> bool: """Allow only set, frozenset and self.__class__-derived objects in binops.""" return isinstance(obj, _set_binop_bases + (self.__class__,)) -def _set_binops_check_loose(self, obj): +def _set_binops_check_loose(self: Any, obj: Any) -> bool: """Allow anything set-like to participate in set binops.""" return ( isinstance(obj, _set_binop_bases + (self.__class__,)) |
