of mutable=True) if __eq__() is not overridden or a comparison function is not provided.
- The default "precision" and "scale" arguments of Numeric and Float have been removed
and now default to None. NUMERIC and FLOAT will be rendered with no numeric arguments
- by default unless these values are provided.
\ No newline at end of file
+ by default unless these values are provided.
+ - AbstractType.get_search_list() is removed - the games that was used for are no
+ longer necessary.
+
+
\ No newline at end of file
import sqlalchemy.exc as exceptions
sys.modules['sqlalchemy.exceptions'] = exceptions
-from sqlalchemy.types import (
- BLOB,
- BOOLEAN,
- Binary,
- Boolean,
- CHAR,
- CLOB,
- DATE,
- DATETIME,
- DECIMAL,
- Date,
- DateTime,
- FLOAT,
- Float,
- INT,
- INTEGER,
- Integer,
- Interval,
- NCHAR,
- NVARCHAR,
- NUMERIC,
- Numeric,
- PickleType,
- SMALLINT,
- SmallInteger,
- String,
- TEXT,
- TIME,
- TIMESTAMP,
- Text,
- Time,
- Unicode,
- UnicodeText,
- VARCHAR,
- )
-
from sqlalchemy.sql import (
alias,
and_,
update,
)
+from sqlalchemy.types import (
+ BLOB,
+ BOOLEAN,
+ Binary,
+ Boolean,
+ CHAR,
+ CLOB,
+ DATE,
+ DATETIME,
+ DECIMAL,
+ Date,
+ DateTime,
+ FLOAT,
+ Float,
+ INT,
+ INTEGER,
+ Integer,
+ Interval,
+ NCHAR,
+ NVARCHAR,
+ NUMERIC,
+ Numeric,
+ PickleType,
+ SMALLINT,
+ SmallInteger,
+ String,
+ TEXT,
+ TIME,
+ TIMESTAMP,
+ Text,
+ Time,
+ Unicode,
+ UnicodeText,
+ VARCHAR,
+ )
+
+
from sqlalchemy.schema import (
CheckConstraint,
Column,
import itertools, re
from operator import attrgetter
-from sqlalchemy import util, exc
+from sqlalchemy import util, exc, types as sqltypes
from sqlalchemy.sql import operators
from sqlalchemy.sql.visitors import Visitable, cloned_traverse
import operator
-functions, schema, sql_util, sqltypes = None, None, None, None
+functions, schema, sql_util = None, None, None
DefaultDialect, ClauseAdapter, Annotated = None, None, None
__all__ = [
from sqlalchemy import exc
from sqlalchemy.util import pickle
from sqlalchemy.sql.visitors import Visitable
-from sqlalchemy.sql import expression
-import sys
-expression.sqltypes = sys.modules[__name__]
import sqlalchemy.util as util
NoneType = type(None)
"""
return op
- def get_search_list(self):
- """return a list of classes to test for a match
- when adapting this type to a dialect-specific type.
-
- """
-
- return self.__class__.__mro__[0:-1]
-
def __repr__(self):
return "%s(%s)" % (
self.__class__.__name__,
class TypeEngine(AbstractType):
"""Base for built-in types."""
+ @util.memoized_property
+ def _impl_dict(self):
+ return {}
+
def dialect_impl(self, dialect, **kwargs):
try:
return self._impl_dict[dialect.__class__]
- except AttributeError:
- self._impl_dict = {}
- return self._impl_dict.setdefault(dialect.__class__, dialect.__class__.type_descriptor(self))
except KeyError:
return self._impl_dict.setdefault(dialect.__class__, dialect.__class__.type_descriptor(self))
def __getstate__(self):
d = self.__dict__.copy()
- d['_impl_dict'] = {}
+ d.pop('_impl_dict', None)
return d
def bind_processor(self, dialect):
def __init__(self, *args, **kwargs):
if not hasattr(self.__class__, 'impl'):
- raise AssertionError("TypeDecorator implementations require a class-level variable 'impl' which refers to the class of type being decorated")
+ raise AssertionError("TypeDecorator implementations require a class-level "
+ "variable 'impl' which refers to the class of type being decorated")
self.impl = self.__class__.impl(*args, **kwargs)
def dialect_impl(self, dialect):
def adapt_type(typeobj, colspecs):
if isinstance(typeobj, type):
typeobj = typeobj()
- for t in typeobj.get_search_list():
+ for t in typeobj.__class__.__mro__[0:-1]:
try:
impltype = colspecs[t]
break