summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/declarative/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-01-06 01:19:47 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2019-01-06 18:23:11 -0500
commit1e278de4cc9a4181e0747640a960e80efcea1ca9 (patch)
tree13d0c035807613bfa07e734acad79b9c843cb8b0 /lib/sqlalchemy/ext/declarative/base.py
parent1e1a38e7801f410f244e4bbb44ec795ae152e04e (diff)
downloadsqlalchemy-1e278de4cc9a4181e0747640a960e80efcea1ca9.tar.gz
Post black reformatting
Applied on top of a pure run of black -l 79 in I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes resolves all remaining flake8 conditions for those codes we have enabled in setup.cfg. Included are resolutions for all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
Diffstat (limited to 'lib/sqlalchemy/ext/declarative/base.py')
-rw-r--r--lib/sqlalchemy/ext/declarative/base.py41
1 files changed, 25 insertions, 16 deletions
diff --git a/lib/sqlalchemy/ext/declarative/base.py b/lib/sqlalchemy/ext/declarative/base.py
index 07778f733..3c83b0b0e 100644
--- a/lib/sqlalchemy/ext/declarative/base.py
+++ b/lib/sqlalchemy/ext/declarative/base.py
@@ -6,20 +6,28 @@
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Internal implementation for declarative."""
-from ...schema import Table, Column
-from ...orm import mapper, class_mapper, synonym
-from ...orm.interfaces import MapperProperty
-from ...orm.properties import ColumnProperty, CompositeProperty
-from ...orm.attributes import QueryableAttribute
-from ...orm.base import _is_mapped_class, InspectionAttr
-from ... import util, exc
-from ...util import topological
-from ...sql import expression
-from ... import event
-from . import clsregistry
import collections
import weakref
+
from sqlalchemy.orm import instrumentation
+from . import clsregistry
+from ... import event
+from ... import exc
+from ... import util
+from ...orm import class_mapper
+from ...orm import mapper
+from ...orm import synonym
+from ...orm.attributes import QueryableAttribute
+from ...orm.base import _is_mapped_class
+from ...orm.base import InspectionAttr
+from ...orm.interfaces import MapperProperty
+from ...orm.properties import ColumnProperty
+from ...orm.properties import CompositeProperty
+from ...schema import Column
+from ...schema import Table
+from ...sql import expression
+from ...util import topological
+
declared_attr = declarative_props = None
@@ -228,9 +236,9 @@ class _MapperConfig(object):
# make a copy of it so a class-level dictionary
# is not overwritten when we update column-based
# arguments.
- mapper_args_fn = lambda: dict(
- cls.__mapper_args__
- ) # noqa
+ def mapper_args_fn():
+ return dict(cls.__mapper_args__)
+
elif name == "__tablename__":
check_decl = _check_declared_props_nocascade(
obj, name, cls
@@ -283,8 +291,9 @@ class _MapperConfig(object):
# defined attribute here to allow a clean
# override, if there's another
# subclass below then it still tries to use
- # this. not sure if there is enough information
- # here to add this as a feature later on.
+ # this. not sure if there is enough
+ # information here to add this as a feature
+ # later on.
util.warn(
"Attribute '%s' on class %s cannot be "
"processed due to "