From 2b070a20c2ecf5bfcb85199467e07736f8988e81 Mon Sep 17 00:00:00 2001 From: Brad Allen Date: Tue, 15 Mar 2011 18:13:53 -0400 Subject: [PATCH] Docstring for TypeDecorator.__init__ --- lib/sqlalchemy/types.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 " -- 2.47.2