]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- the "type_map" dictionary in sqlalchemy.types is now private,
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 28 Nov 2010 18:07:00 +0000 (13:07 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 28 Nov 2010 18:07:00 +0000 (13:07 -0500)
i.e. is named "_type_map". [ticket:1870]

lib/sqlalchemy/sql/expression.py
lib/sqlalchemy/types.py
test/aaa_profiling/test_compiler.py

index 3cfe0a14c5f6cf1700db2422d8b1e1a6a1c24605..44adb7634367c1e4231a00c1d693b2d84c7f317e 100644 (file)
@@ -2400,7 +2400,7 @@ class _BindParamClause(ColumnElement):
                     _compared_to_type._coerce_compared_value(
                         _compared_to_operator, value)
             else:
-                self.type = sqltypes.type_map.get(type(value),
+                self.type = sqltypes._type_map.get(type(value),
                         sqltypes.NULLTYPE)
         elif isinstance(type_, type):
             self.type = type_()
index 782e9f15eab01bc8be33e67faecbc0a8819b6811..13dbc6a831502f3341e459aeccbe757c62c6b738 100644 (file)
@@ -18,7 +18,7 @@ __all__ = [ 'TypeEngine', 'TypeDecorator', 'AbstractType', 'UserDefinedType',
             'String', 'Integer', 'SmallInteger', 'BigInteger', 'Numeric',
             'Float', 'DateTime', 'Date', 'Time', 'LargeBinary', 'Binary',
             'Boolean', 'Unicode', 'MutableType', 'Concatenable',
-            'UnicodeText','PickleType', 'Interval', 'type_map', 'Enum' ]
+            'UnicodeText','PickleType', 'Interval', 'Enum' ]
 
 import inspect
 import datetime as dt
@@ -117,7 +117,7 @@ class AbstractType(Visitable):
             return self.__class__
     
     def _coerce_compared_value(self, op, value):
-        _coerced_type = type_map.get(type(value), NULLTYPE)
+        _coerced_type = _type_map.get(type(value), NULLTYPE)
         if _coerced_type is NULLTYPE or _coerced_type._type_affinity \
             is self._type_affinity:
             return self
@@ -1930,10 +1930,8 @@ STRINGTYPE = String()
 
 # using VARCHAR/NCHAR so that we dont get the genericized "String"
 # type which usually resolves to TEXT/CLOB
-# NOTE: this dict is not meant to be public and will be underscored
-# in 0.7, see [ticket:1870]. 
 
-type_map = {
+_type_map = {
     str: String(),
     # Py3K
     #bytes : LargeBinary(),
index bc589c0b2fdb87447d0d875140c5a2ea8f58695c..160385e9576866c55e6d371861a357bccdbd7f06 100644 (file)
@@ -27,7 +27,7 @@ class CompileTest(TestBase, AssertsExecutionResults):
             for c in t.c:
                 c.type._type_affinity
         from sqlalchemy import types
-        for t in types.type_map.values():
+        for t in types._type_map.values():
             t._type_affinity
             
     @profiling.function_call_count(69, {'2.4': 44,