diff options
Diffstat (limited to 'lib/sqlalchemy/sql/annotation.py')
| -rw-r--r-- | lib/sqlalchemy/sql/annotation.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/sqlalchemy/sql/annotation.py b/lib/sqlalchemy/sql/annotation.py index c1d484d95..64cfa630e 100644 --- a/lib/sqlalchemy/sql/annotation.py +++ b/lib/sqlalchemy/sql/annotation.py @@ -76,8 +76,7 @@ class Annotated(object): return self._with_annotations(_values) def _compiler_dispatch(self, visitor, **kw): - return self.__element.__class__._compiler_dispatch( - self, visitor, **kw) + return self.__element.__class__._compiler_dispatch(self, visitor, **kw) @property def _constructor(self): @@ -120,10 +119,13 @@ def _deep_annotate(element, annotations, exclude=None): Elements within the exclude collection will be cloned but not annotated. """ + def clone(elem): - if exclude and \ - hasattr(elem, 'proxy_set') and \ - elem.proxy_set.intersection(exclude): + if ( + exclude + and hasattr(elem, "proxy_set") + and elem.proxy_set.intersection(exclude) + ): newelem = elem._clone() elif annotations != elem._annotations: newelem = elem._annotate(annotations) @@ -191,8 +193,8 @@ def _new_annotation_type(cls, base_cls): break annotated_classes[cls] = anno_cls = type( - "Annotated%s" % cls.__name__, - (base_cls, cls), {}) + "Annotated%s" % cls.__name__, (base_cls, cls), {} + ) globals()["Annotated%s" % cls.__name__] = anno_cls return anno_cls |
