]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add performance improvement for Enum w/ Python 2 enum library
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 10 Jul 2019 20:12:48 +0000 (16:12 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 11 Jul 2019 04:21:08 +0000 (00:21 -0400)
commit75fdcacc85f00b8d1b382b4343014e2a503080bc
tree0a11fe76c0ea5ab751195228a09abd0e5a09ef98
parent6e0fcfd5603f958520a5d01275777945478a3685
Add performance improvement for Enum w/ Python 2 enum library

Adjusted the initialization for :class:`.Enum` to minimize how often it
invokes the ``.__members__`` attribute of a given PEP-435 enumeration
object, to suit the case where this attribute is expensive to invoke, as is
the case for some popular third party enumeration libraries.

Fixes: #4758
Change-Id: Iffeb854c67393bdcb288944fc357a074e20e1325
(cherry picked from commit 2cc7308c96f5598ba0aea9a240b9a52629042d07)
doc/build/changelog/unreleased_13/4758.rst [new file with mode: 0644]
lib/sqlalchemy/sql/sqltypes.py
test/aaa_profiling/test_misc.py [new file with mode: 0644]
test/profiles.txt