summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2021-11-21 20:36:35 +0100
committerFederico Caselli <cfederico87@gmail.com>2021-11-22 15:03:17 +0000
commit0b95f0055be252b13e99b0a944466f60b5e367ff (patch)
tree6ae4135fd408c4e69582c4f6fa458b007553aeab /lib/sqlalchemy/sql
parente04baa2953fb5d0d29f5dca01ea6882bf1fa1cd4 (diff)
downloadsqlalchemy-0b95f0055be252b13e99b0a944466f60b5e367ff.tar.gz
Remove object in class definition
References: #4600 Change-Id: I2a62ddfe00bc562720f0eae700a497495d7a987a
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r--lib/sqlalchemy/sql/annotation.py4
-rw-r--r--lib/sqlalchemy/sql/base.py10
-rw-r--r--lib/sqlalchemy/sql/coercions.py16
-rw-r--r--lib/sqlalchemy/sql/compiler.py4
-rw-r--r--lib/sqlalchemy/sql/dml.py2
-rw-r--r--lib/sqlalchemy/sql/elements.py2
-rw-r--r--lib/sqlalchemy/sql/functions.py2
-rw-r--r--lib/sqlalchemy/sql/lambdas.py6
-rw-r--r--lib/sqlalchemy/sql/naming.py2
-rw-r--r--lib/sqlalchemy/sql/operators.py4
-rw-r--r--lib/sqlalchemy/sql/roles.py6
-rw-r--r--lib/sqlalchemy/sql/schema.py4
-rw-r--r--lib/sqlalchemy/sql/selectable.py14
-rw-r--r--lib/sqlalchemy/sql/sqltypes.py6
-rw-r--r--lib/sqlalchemy/sql/traversals.py4
-rw-r--r--lib/sqlalchemy/sql/type_api.py6
-rw-r--r--lib/sqlalchemy/sql/util.py4
-rw-r--r--lib/sqlalchemy/sql/visitors.py2
18 files changed, 49 insertions, 49 deletions
diff --git a/lib/sqlalchemy/sql/annotation.py b/lib/sqlalchemy/sql/annotation.py
index e6618937a..88f045fe6 100644
--- a/lib/sqlalchemy/sql/annotation.py
+++ b/lib/sqlalchemy/sql/annotation.py
@@ -20,7 +20,7 @@ from .. import util
EMPTY_ANNOTATIONS = util.immutabledict()
-class SupportsAnnotations(object):
+class SupportsAnnotations:
_annotations = EMPTY_ANNOTATIONS
@util.memoized_property
@@ -122,7 +122,7 @@ class SupportsWrappingAnnotations(SupportsAnnotations):
return self
-class Annotated(object):
+class Annotated:
"""clones a SupportsAnnotated and applies an 'annotations' dictionary.
Unlike regular clones, this clone also mimics __hash__() and
diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py
index 0c375b6d7..b57da3289 100644
--- a/lib/sqlalchemy/sql/base.py
+++ b/lib/sqlalchemy/sql/base.py
@@ -35,7 +35,7 @@ type_api = None
NO_ARG = util.symbol("NO_ARG")
-class Immutable(object):
+class Immutable:
"""mark a ClauseElement as 'immutable' when expressions are cloned."""
_is_immutable = True
@@ -276,7 +276,7 @@ def _kw_reg_for_dialect(dialect_name):
return dict(dialect_cls.construct_arguments)
-class DialectKWArgs(object):
+class DialectKWArgs:
"""Establish the ability for a class to have dialect-specific arguments
with defaults and constructor validation.
@@ -451,7 +451,7 @@ class DialectKWArgs(object):
construct_arg_dictionary[arg_name] = kwargs[k]
-class CompileState(object):
+class CompileState:
"""Produces additional object state necessary for a statement to be
compiled.
@@ -1056,7 +1056,7 @@ class prefix_anon_map(dict):
return value
-class SchemaEventTarget(object):
+class SchemaEventTarget:
"""Base class for elements that are the targets of :class:`.DDLEvents`
events.
@@ -1079,7 +1079,7 @@ class SchemaVisitor(ClauseVisitor):
__traverse_options__ = {"schema_visitor": True}
-class ColumnCollection(object):
+class ColumnCollection:
"""Collection of :class:`_expression.ColumnElement` instances,
typically for
:class:`_sql.FromClause` objects.
diff --git a/lib/sqlalchemy/sql/coercions.py b/lib/sqlalchemy/sql/coercions.py
index f888bad4c..f051ba12f 100644
--- a/lib/sqlalchemy/sql/coercions.py
+++ b/lib/sqlalchemy/sql/coercions.py
@@ -235,7 +235,7 @@ def expect_col_expression_collection(role, expressions):
yield resolved, column, strname, add_element
-class RoleImpl(object):
+class RoleImpl:
__slots__ = ("_role_class", "name", "_use_inspection")
def _literal_coercion(self, element, **kw):
@@ -282,7 +282,7 @@ class RoleImpl(object):
util.raise_(exc.ArgumentError(msg, code=code), replace_context=err)
-class _Deannotate(object):
+class _Deannotate:
__slots__ = ()
def _post_coercion(self, resolved, **kw):
@@ -291,13 +291,13 @@ class _Deannotate(object):
return _deep_deannotate(resolved)
-class _StringOnly(object):
+class _StringOnly:
__slots__ = ()
_resolve_literal_only = True
-class _ReturnsStringKey(object):
+class _ReturnsStringKey:
__slots__ = ()
def _implicit_coercions(
@@ -312,7 +312,7 @@ class _ReturnsStringKey(object):
return element
-class _ColumnCoercions(object):
+class _ColumnCoercions:
__slots__ = ()
def _warn_for_scalar_subquery_coercion(self):
@@ -358,7 +358,7 @@ def _no_text_coercion(
)
-class _NoTextCoercion(object):
+class _NoTextCoercion:
__slots__ = ()
def _literal_coercion(self, element, argname=None, **kw):
@@ -370,7 +370,7 @@ class _NoTextCoercion(object):
self._raise_for_expected(element, argname)
-class _CoerceLiterals(object):
+class _CoerceLiterals:
__slots__ = ()
_coerce_consts = False
_coerce_star = False
@@ -417,7 +417,7 @@ class LiteralValueImpl(RoleImpl):
return element
-class _SelectIsNotFrom(object):
+class _SelectIsNotFrom:
__slots__ = ()
def _raise_for_expected(self, element, argname=None, resolved=None, **kw):
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 191a07299..482afb42f 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -357,7 +357,7 @@ class FromLinter(collections.namedtuple("FromLinter", ["froms", "edges"])):
util.warn(message)
-class Compiled(object):
+class Compiled:
"""Represent a compiled SQL or DDL expression.
@@ -4970,7 +4970,7 @@ class StrSQLTypeCompiler(GenericTypeCompiler):
return get_col_spec(**kw)
-class IdentifierPreparer(object):
+class IdentifierPreparer:
"""Handle quoting and case-folding of identifiers based on options."""
diff --git a/lib/sqlalchemy/sql/dml.py b/lib/sqlalchemy/sql/dml.py
index 03968d284..e45c6b888 100644
--- a/lib/sqlalchemy/sql/dml.py
+++ b/lib/sqlalchemy/sql/dml.py
@@ -1017,7 +1017,7 @@ class Insert(ValuesBase):
self.select = coercions.expect(roles.DMLSelectRole, select)
-class DMLWhereBase(object):
+class DMLWhereBase:
_where_criteria = ()
@_generative
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index a279f634d..6893d99ee 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -1142,7 +1142,7 @@ class ColumnElement(
return self._anon_label(label, add_hash=idx)
-class WrapsColumnExpression(object):
+class WrapsColumnExpression:
"""Mixin that defines a :class:`_expression.ColumnElement`
as a wrapper with special
labeling behavior for an expression that already has a name.
diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py
index 35b0cb7d7..31f4fab0d 100644
--- a/lib/sqlalchemy/sql/functions.py
+++ b/lib/sqlalchemy/sql/functions.py
@@ -662,7 +662,7 @@ class ScalarFunctionColumn(NamedColumn):
self.type = sqltypes.to_instance(type_)
-class _FunctionGenerator(object):
+class _FunctionGenerator:
"""Generate SQL function expressions.
:data:`.func` is a special object instance which generates SQL
diff --git a/lib/sqlalchemy/sql/lambdas.py b/lib/sqlalchemy/sql/lambdas.py
index e7c19b9a0..110260799 100644
--- a/lib/sqlalchemy/sql/lambdas.py
+++ b/lib/sqlalchemy/sql/lambdas.py
@@ -596,7 +596,7 @@ class LinkedLambdaElement(StatementLambdaElement):
return fn(self.parent_lambda._resolved)
-class AnalyzedCode(object):
+class AnalyzedCode:
__slots__ = (
"track_closure_variables",
"track_bound_values",
@@ -941,7 +941,7 @@ class AnalyzedCode(object):
)
-class NonAnalyzedFunction(object):
+class NonAnalyzedFunction:
__slots__ = ("expr",)
closure_bindparams = None
@@ -955,7 +955,7 @@ class NonAnalyzedFunction(object):
return self.expr
-class AnalyzedFunction(object):
+class AnalyzedFunction:
__slots__ = (
"analyzed_code",
"fn",
diff --git a/lib/sqlalchemy/sql/naming.py b/lib/sqlalchemy/sql/naming.py
index d01eabb58..3d86018ee 100644
--- a/lib/sqlalchemy/sql/naming.py
+++ b/lib/sqlalchemy/sql/naming.py
@@ -27,7 +27,7 @@ from .. import event
from .. import exc
-class ConventionDict(object):
+class ConventionDict:
def __init__(self, const, table, convention):
self.const = const
self._is_fk = isinstance(const, ForeignKeyConstraint)
diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py
index b64bea07a..675048cd0 100644
--- a/lib/sqlalchemy/sql/operators.py
+++ b/lib/sqlalchemy/sql/operators.py
@@ -33,7 +33,7 @@ from operator import truediv
from .. import util
-class Operators(object):
+class Operators:
"""Base of comparison and logical operators.
Implements base methods
@@ -227,7 +227,7 @@ class Operators(object):
raise NotImplementedError(str(op))
-class custom_op(object):
+class custom_op:
"""Represent a 'custom' operator.
:class:`.custom_op` is normally instantiated when the
diff --git a/lib/sqlalchemy/sql/roles.py b/lib/sqlalchemy/sql/roles.py
index 70ad4cefa..4e009aa26 100644
--- a/lib/sqlalchemy/sql/roles.py
+++ b/lib/sqlalchemy/sql/roles.py
@@ -8,7 +8,7 @@
from .. import util
-class SQLRole(object):
+class SQLRole:
"""Define a "role" within a SQL statement structure.
Classes within SQL Core participate within SQLRole hierarchies in order
@@ -23,12 +23,12 @@ class SQLRole(object):
uses_inspection = False
-class UsesInspection(object):
+class UsesInspection:
_post_inspect = None
uses_inspection = True
-class AllowsLambdaRole(object):
+class AllowsLambdaRole:
allows_lambda = True
diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py
index c8f26f906..4bd49c468 100644
--- a/lib/sqlalchemy/sql/schema.py
+++ b/lib/sqlalchemy/sql/schema.py
@@ -2639,7 +2639,7 @@ class ColumnDefault(DefaultGenerator):
return "ColumnDefault(%r)" % (self.arg,)
-class IdentityOptions(object):
+class IdentityOptions:
"""Defines options for a named database sequence or an identity column.
.. versionadded:: 1.3.18
@@ -3173,7 +3173,7 @@ class Constraint(DialectKWArgs, SchemaItem):
raise NotImplementedError()
-class ColumnCollectionMixin(object):
+class ColumnCollectionMixin:
columns = None
"""A :class:`_expression.ColumnCollection` of :class:`_schema.Column`
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py
index 350e55c49..a04b205b5 100644
--- a/lib/sqlalchemy/sql/selectable.py
+++ b/lib/sqlalchemy/sql/selectable.py
@@ -228,7 +228,7 @@ class Selectable(ReturnsRows):
)
-class HasPrefixes(object):
+class HasPrefixes:
_prefixes = ()
_has_prefixes_traverse_internals = [
@@ -284,7 +284,7 @@ class HasPrefixes(object):
)
-class HasSuffixes(object):
+class HasSuffixes:
_suffixes = ()
_has_suffixes_traverse_internals = [
@@ -335,7 +335,7 @@ class HasSuffixes(object):
)
-class HasHints(object):
+class HasHints:
_hints = util.immutabledict()
_statement_hints = ()
@@ -1549,7 +1549,7 @@ class Join(roles.DMLTableRole, FromClause):
return [self] + self.left._from_objects + self.right._from_objects
-class NoInit(object):
+class NoInit:
def __init__(self, *arg, **kw):
raise NotImplementedError(
"The %s class is not intended to be constructed "
@@ -3360,7 +3360,7 @@ class SelectStatementGrouping(GroupedElement, SelectBase):
return self.element._from_objects
-class DeprecatedSelectBaseGenerations(object):
+class DeprecatedSelectBaseGenerations:
"""A collection of methods available on :class:`_sql.Select` and
:class:`_sql.CompoundSelect`, these are all **deprecated** methods as they
modify the object in-place.
@@ -4214,7 +4214,7 @@ class CompoundSelect(HasCompileState, GenerativeSelect):
self._bind = bind
-class DeprecatedSelectGenerations(object):
+class DeprecatedSelectGenerations:
"""A collection of methods available on :class:`_sql.Select`, these
are all **deprecated** methods as they modify the :class:`_sql.Select`
object in -place.
@@ -4730,7 +4730,7 @@ class SelectState(util.MemoizedSlots, CompileState):
return replace_from_obj_index
-class _SelectFromElements(object):
+class _SelectFromElements:
def _iterate_from_elements(self):
# note this does not include elements
# in _setup_joins or _legacy_setup_joins
diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py
index 52033f586..1687c9f29 100644
--- a/lib/sqlalchemy/sql/sqltypes.py
+++ b/lib/sqlalchemy/sql/sqltypes.py
@@ -44,7 +44,7 @@ from ..util import OrderedDict
from ..util import pickle
-class _LookupExpressionAdapter(object):
+class _LookupExpressionAdapter:
"""Mixin expression adaptations based on lookup tables.
@@ -75,7 +75,7 @@ class _LookupExpressionAdapter(object):
comparator_factory = Comparator
-class Concatenable(object):
+class Concatenable:
"""A mixin that marks a type as supporting 'concatenation',
typically strings."""
@@ -95,7 +95,7 @@ class Concatenable(object):
comparator_factory = Comparator
-class Indexable(object):
+class Indexable:
"""A mixin that marks a type as supporting indexing operations,
such as array or JSON structures.
diff --git a/lib/sqlalchemy/sql/traversals.py b/lib/sqlalchemy/sql/traversals.py
index 3d377271f..6acd794aa 100644
--- a/lib/sqlalchemy/sql/traversals.py
+++ b/lib/sqlalchemy/sql/traversals.py
@@ -48,7 +48,7 @@ def _preconfigure_traversals(target_hierarchy):
)
-class HasCacheKey(object):
+class HasCacheKey:
_cache_key_traversal = NO_CACHE
__slots__ = ()
@@ -713,7 +713,7 @@ class _CacheKey(ExtendedInternalTraversal):
_cache_key_traversal_visitor = _CacheKey()
-class HasCopyInternals(object):
+class HasCopyInternals:
def _clone(self, **kw):
raise NotImplementedError()
diff --git a/lib/sqlalchemy/sql/type_api.py b/lib/sqlalchemy/sql/type_api.py
index 5e929c4a9..01763f266 100644
--- a/lib/sqlalchemy/sql/type_api.py
+++ b/lib/sqlalchemy/sql/type_api.py
@@ -810,7 +810,7 @@ class VisitableCheckKWArg(util.EnsureKWArgType, TraversibleType):
pass
-class ExternalType(object):
+class ExternalType:
"""mixin that defines attributes and behaviors specific to third-party
datatypes.
@@ -1064,7 +1064,7 @@ class UserDefinedType(
return self
-class Emulated(object):
+class Emulated:
"""Mixin for base types that emulate the behavior of a DB-native type.
An :class:`.Emulated` type will use an available database type
@@ -1111,7 +1111,7 @@ class Emulated(object):
return super(Emulated, self).adapt(impltype, **kw)
-class NativeForEmulated(object):
+class NativeForEmulated:
"""Indicates DB-native types supported by an :class:`.Emulated` type.
.. versionadded:: 1.2.0b3
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py
index 7fcb45709..6394c43a0 100644
--- a/lib/sqlalchemy/sql/util.py
+++ b/lib/sqlalchemy/sql/util.py
@@ -461,7 +461,7 @@ def _quote_ddl_expr(element):
return repr(element)
-class _repr_base(object):
+class _repr_base:
_LIST = 0
_TUPLE = 1
_DICT = 2
@@ -969,7 +969,7 @@ class ColumnAdapter(ClauseAdapter):
self.allow_label_resolve = allow_label_resolve
self._wrap = None
- class _IncludeExcludeMapping(object):
+ class _IncludeExcludeMapping:
def __init__(self, parent, columns):
self.parent = parent
self.columns = columns
diff --git a/lib/sqlalchemy/sql/visitors.py b/lib/sqlalchemy/sql/visitors.py
index 7111c5efd..82cb7a253 100644
--- a/lib/sqlalchemy/sql/visitors.py
+++ b/lib/sqlalchemy/sql/visitors.py
@@ -506,7 +506,7 @@ class ExtendedInternalTraversal(InternalTraversal):
HasCacheKey objects."""
-class ExternalTraversal(object):
+class ExternalTraversal:
"""Base class for visitor objects which can traverse externally using
the :func:`.visitors.traverse` function.