diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-05-20 13:41:44 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-05-21 14:16:03 -0400 |
| commit | 4550983e0ce2f35b3585e53894c941c23693e71d (patch) | |
| tree | 3928e6e333c2b9bb6e23a4de079565a387d309ae /lib/sqlalchemy/util | |
| parent | 3d55263c92ee29a0257d823124c353a35246cf31 (diff) | |
| download | sqlalchemy-4550983e0ce2f35b3585e53894c941c23693e71d.tar.gz | |
Performance fixes for new result set
A few small mistakes led to huge callcounts. Additionally,
the warn-on-get behavior which is attempting to warn for
deprecated access in SQLAlchemy 2.0 is very expensive; it's not clear
if its feasible to have this warning or to somehow alter how it
works.
Fixes: #5340
Change-Id: I73bdd2d7b6f1b25cc0222accabd585cf761a5af4
Diffstat (limited to 'lib/sqlalchemy/util')
| -rw-r--r-- | lib/sqlalchemy/util/__init__.py | 3 | ||||
| -rw-r--r-- | lib/sqlalchemy/util/_collections.py | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/sqlalchemy/util/__init__.py b/lib/sqlalchemy/util/__init__.py index 695985a91..6a0b065ee 100644 --- a/lib/sqlalchemy/util/__init__.py +++ b/lib/sqlalchemy/util/__init__.py @@ -148,5 +148,4 @@ from .langhelpers import warn_limited # noqa from .langhelpers import wrap_callable # noqa -# things that used to be not always available, -# but are now as of current support Python versions +SQLALCHEMY_WARN_20 = False diff --git a/lib/sqlalchemy/util/_collections.py b/lib/sqlalchemy/util/_collections.py index 10d80fc98..0990acb83 100644 --- a/lib/sqlalchemy/util/_collections.py +++ b/lib/sqlalchemy/util/_collections.py @@ -52,6 +52,14 @@ class immutabledict(ImmutableContainer, dict): dict.update(new, d) return new + def merge_with(self, *dicts): + new = dict.__new__(self.__class__) + dict.__init__(new, self) + for d in dicts: + if d: + dict.update(new, d) + return new + def __repr__(self): return "immutabledict(%s)" % dict.__repr__(self) |
