From: Brad Allen Date: Tue, 15 Mar 2011 22:13:53 +0000 (-0400) Subject: Docstring for TypeDecorator.__init__ X-Git-Tag: rel_0_7_6~14^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b070a20c2ecf5bfcb85199467e07736f8988e81;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Docstring for TypeDecorator.__init__ --- diff --git a/lib/sqlalchemy/types.py b/lib/sqlalchemy/types.py index c901e938ae..2200511e52 100644 --- a/lib/sqlalchemy/types.py +++ b/lib/sqlalchemy/types.py @@ -390,7 +390,17 @@ class TypeDecorator(TypeEngine): __visit_name__ = "type_decorator" def __init__(self, *args, **kwargs): - """#todo""" + """Initialize the instance accepting the same kind of parameters + as the type being wrapped (as specified in the 'impl' class + attribute). + + Assuming the class level 'impl' is a callable (the common case), + it will be instantiated and assigned to a self.impl instance + attribute (thus overriding the class attribute of the same name). + + If the class level 'impl' is not a callable (the unusual case), + it will be assigned to the same instance attribute 'as-is'. + """ if not hasattr(self.__class__, 'impl'): raise AssertionError("TypeDecorator implementations " "require a class-level variable "