diff options
author | Federico Caselli <cfederico87@gmail.com> | 2021-02-18 19:12:45 +0100 |
---|---|---|
committer | Federico Caselli <cfederico87@gmail.com> | 2021-02-18 20:37:22 +0100 |
commit | 629273a31b1be9ed195e9082d40b8741ab31e073 (patch) | |
tree | 98d90e9a518737d2dfb6176f71654db2c04af728 /lib/sqlalchemy/util/langhelpers.py | |
parent | 227fd31d7d7c9354e51008e5a14e2cb5ee885266 (diff) | |
download | sqlalchemy-629273a31b1be9ed195e9082d40b8741ab31e073.tar.gz |
Minor optimization to the code
* remove the c version of distill params since it's actually slower than
the python one
* add a function to langhelpers to check if the cextensions are active
* minor cleanup to the OrderedSet implementation
Change-Id: Iec3d0c3f0f42cdf51f802aaca342ba37b8783b85
Diffstat (limited to 'lib/sqlalchemy/util/langhelpers.py')
-rw-r--r-- | lib/sqlalchemy/util/langhelpers.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py index 457d2875d..eb582b528 100644 --- a/lib/sqlalchemy/util/langhelpers.py +++ b/lib/sqlalchemy/util/langhelpers.py @@ -1879,3 +1879,14 @@ def repr_tuple_names(names): return ", ".join(res) else: return "%s, ..., %s" % (", ".join(res[0:3]), res[-1]) + + +def has_compiled_ext(): + try: + from sqlalchemy import cimmutabledict # noqa F401 + from sqlalchemy import cprocessors # noqa F401 + from sqlalchemy import cresultproxy # noqa F401 + + return True + except ImportError: + return False |