TypeEngine class, with a deprecation warning.
This so that code which does something like
Integer(11) still succeeds.
=======
CHANGES
=======
+0.7.0b4
+=======
+- sql
+ - Restored the "catchall" constructor on the base
+ TypeEngine class, with a deprecation warning.
+ This so that code which does something like
+ Integer(11) still succeeds.
+
0.7.0b3
=======
- general
__all__ = sorted(name for name, obj in locals().items()
if not (name.startswith('_') or inspect.ismodule(obj)))
-__version__ = '0.7b3'
+__version__ = '0.7b4'
del inspect, sys
encode('ascii', 'backslashreplace')
# end Py2K
- def __init__(self):
- # supports getargspec of the __init__ method
- # used by generic __repr__
- pass
+ def __init__(self, *args, **kwargs):
+ """Support implementations that were passing arguments"""
+ if args or kwargs:
+ util.warn_deprecated("Passing arguments to type object "
+ "constructor %s is deprecated" % self.__class__)
def __repr__(self):
return "%s(%s)" % (
continue
eq_(getattr(t2, k), t1.__dict__[k])
+ def test_plain_init_deprecation_warning(self):
+ for typ in (Integer, Date, SmallInteger):
+ assert_raises_message(
+ exc.SADeprecationWarning,
+ "Passing arguments to type object "
+ "constructor %s is deprecated" % typ,
+ typ, 11
+ )
class TypeAffinityTest(TestBase):
def test_type_affinity(self):