diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-11 18:01:31 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-11 18:01:31 -0500 |
| commit | be66013111e681dbfc1733fedbba0f101727b6b9 (patch) | |
| tree | 379b2e8163f05e2643e3bde0edbec500e953e7e2 /lib/sqlalchemy | |
| parent | 24acb8f95a68b3c1bdd26f4ce5c26adcbce5164d (diff) | |
| download | sqlalchemy-be66013111e681dbfc1733fedbba0f101727b6b9.tar.gz | |
hey we have .. note:: for notes, duh
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/types.py | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/lib/sqlalchemy/types.py b/lib/sqlalchemy/types.py index c66624b5f..434fb07c3 100644 --- a/lib/sqlalchemy/types.py +++ b/lib/sqlalchemy/types.py @@ -1013,37 +1013,37 @@ class Numeric(_DateAffinity, TypeEngine): ``decimal.Decimal`` objects by default, applying conversion as needed. - Note that the `cdecimal <http://pypi.python.org/pypi/cdecimal/>`_ library - is a high performing alternative - to Python's built-in ``decimal.Decimal`` type, which performs very poorly - in high volume situations. SQLAlchemy 0.7 is tested against ``cdecimal`` - and supports it fully. The type is not necessarily supported by - DBAPI implementations however, most of which contain an import - for plain ``decimal`` in their source code, even though - some such as psycopg2 provide hooks for alternate adapters. - SQLAlchemy imports ``decimal`` globally as well. While the - alternate ``Decimal`` class can be patched into SQLA's ``decimal`` module, - overall the most straightforward and foolproof way to use - "cdecimal" given current DBAPI and Python support is to patch it directly - into sys.modules before anything else is imported:: + .. note:: The `cdecimal <http://pypi.python.org/pypi/cdecimal/>`_ library + is a high performing alternative to Python's built-in + ``decimal.Decimal`` type, which performs very poorly in high volume + situations. SQLAlchemy 0.7 is tested against ``cdecimal`` and supports + it fully. The type is not necessarily supported by DBAPI + implementations however, most of which contain an import for plain + ``decimal`` in their source code, even though some such as psycopg2 + provide hooks for alternate adapters. SQLAlchemy imports ``decimal`` + globally as well. While the alternate ``Decimal`` class can be patched + into SQLA's ``decimal`` module, overall the most straightforward and + foolproof way to use "cdecimal" given current DBAPI and Python support + is to patch it directly into sys.modules before anything else is + imported:: - import sys - import cdecimal - sys.modules["decimal"] = cdecimal + import sys + import cdecimal + sys.modules["decimal"] = cdecimal - While the global patch is a little ugly, it's particularly - important to use just one decimal library at a time since - Python Decimal and cdecimal Decimal objects - are not currently compatible *with each other*:: + While the global patch is a little ugly, it's particularly + important to use just one decimal library at a time since + Python Decimal and cdecimal Decimal objects + are not currently compatible *with each other*:: - >>> import cdecimal - >>> import decimal - >>> decimal.Decimal("10") == cdecimal.Decimal("10") - False - - SQLAlchemy will provide more natural support of - cdecimal if and when it becomes a standard part of Python - installations and is supported by all DBAPIs. + >>> import cdecimal + >>> import decimal + >>> decimal.Decimal("10") == cdecimal.Decimal("10") + False + + SQLAlchemy will provide more natural support of + cdecimal if and when it becomes a standard part of Python + installations and is supported by all DBAPIs. """ |
