summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/elements.py
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2021-12-27 15:26:31 +0000
committerGerrit Code Review <gerrit@ci3.zzzcomputing.com>2021-12-27 15:26:31 +0000
commit4a12848a1cf47ed43c93c5ee8029b644242d0a17 (patch)
tree233c3862dc5734becb9ed2d9cf7f95a71382de77 /lib/sqlalchemy/sql/elements.py
parent2bb6cfc7c9b8f09eaa4efeffc337a1162993979c (diff)
parente6cd36fc51d25922f20aa203229a636f5d6daabe (diff)
downloadsqlalchemy-4a12848a1cf47ed43c93c5ee8029b644242d0a17.tar.gz
Merge "implement cython for cache_anon_map, prefix_anon_map" into main
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-rw-r--r--lib/sqlalchemy/sql/elements.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index 75798502a..028743706 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -1662,14 +1662,9 @@ class BindParameter(roles.InElementRole, ColumnElement):
anon_map[NO_CACHE] = True
return None
- idself = id(self)
- if idself in anon_map:
- return (anon_map[idself], self.__class__)
- else:
- # inline of
- # id_ = anon_map[idself]
- anon_map[idself] = id_ = str(anon_map.index)
- anon_map.index += 1
+ id_, found = anon_map.get_anon(self)
+ if found:
+ return (id_, self.__class__)
if bindparams is not None:
bindparams.append(self)