]> 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:19:34 +0000 (00:19 -0400)
commit2cc7308c96f5598ba0aea9a240b9a52629042d07
treedcef3a5e5831ad20f012c1ab31469f5d0cd91c4e
parent3238d953b42f67761dc3019bd27f2960ae2e525f
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
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