summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/cyextension
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2022-10-21 21:11:23 +0200
committerFederico Caselli <cfederico87@gmail.com>2022-10-22 09:55:49 +0200
commit25619f27836e80351e078c8badc47b3e0acccf5d (patch)
treef9001942299288f1c6dfbd7d2179b15514330a5b /lib/sqlalchemy/cyextension
parentbbf68345f4993245689b96cc6c6a50013afa3caa (diff)
downloadsqlalchemy-25619f27836e80351e078c8badc47b3e0acccf5d.tar.gz
Add pep 584 to python immutabledict fallback
Fixes: #8695 Change-Id: Ie0412c3a7b2b1ba5bd5112f204318ff763cbb8f4
Diffstat (limited to 'lib/sqlalchemy/cyextension')
-rw-r--r--lib/sqlalchemy/cyextension/immutabledict.pyx7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sqlalchemy/cyextension/immutabledict.pyx b/lib/sqlalchemy/cyextension/immutabledict.pyx
index 6ab255311..100287b38 100644
--- a/lib/sqlalchemy/cyextension/immutabledict.pyx
+++ b/lib/sqlalchemy/cyextension/immutabledict.pyx
@@ -32,6 +32,7 @@ class ImmutableDictBase(dict):
__delitem__ = __setitem__ = __setattr__ = _immutable
clear = pop = popitem = setdefault = update = _immutable
+
cdef class immutabledict(dict):
def __repr__(self):
return f"immutabledict({dict.__repr__(self)})"
@@ -118,7 +119,9 @@ cdef class immutabledict(dict):
_immutable_fn(self)
def __or__(self, other):
- return immutabledict(super().__or__(other))
+ return immutabledict(dict.__or__(self, other))
def __ror__(self, other):
- return immutabledict(super().__ror__(other))
+ # NOTE: this is used only in cython 3.x;
+ # version 0.x will call __or__ with args inversed
+ return immutabledict(dict.__ror__(self, other))