diff options
author | Federico Caselli <cfederico87@gmail.com> | 2021-11-21 20:36:35 +0100 |
---|---|---|
committer | Federico Caselli <cfederico87@gmail.com> | 2021-11-22 15:03:17 +0000 |
commit | 0b95f0055be252b13e99b0a944466f60b5e367ff (patch) | |
tree | 6ae4135fd408c4e69582c4f6fa458b007553aeab /lib/sqlalchemy/ext | |
parent | e04baa2953fb5d0d29f5dca01ea6882bf1fa1cd4 (diff) | |
download | sqlalchemy-0b95f0055be252b13e99b0a944466f60b5e367ff.tar.gz |
Remove object in class definition
References: #4600
Change-Id: I2a62ddfe00bc562720f0eae700a497495d7a987a
Diffstat (limited to 'lib/sqlalchemy/ext')
-rw-r--r-- | lib/sqlalchemy/ext/associationproxy.py | 6 | ||||
-rw-r--r-- | lib/sqlalchemy/ext/automap.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/ext/baked.py | 6 | ||||
-rw-r--r-- | lib/sqlalchemy/ext/compiler.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/ext/declarative/extensions.py | 4 | ||||
-rw-r--r-- | lib/sqlalchemy/ext/hybrid.py | 16 | ||||
-rw-r--r-- | lib/sqlalchemy/ext/instrumentation.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/ext/mutable.py | 6 |
8 files changed, 22 insertions, 22 deletions
diff --git a/lib/sqlalchemy/ext/associationproxy.py b/lib/sqlalchemy/ext/associationproxy.py index a93f2c229..0aa836a3c 100644 --- a/lib/sqlalchemy/ext/associationproxy.py +++ b/lib/sqlalchemy/ext/associationproxy.py @@ -306,7 +306,7 @@ class AssociationProxy(interfaces.InspectionAttrInfo): ) -class AssociationProxyInstance(object): +class AssociationProxyInstance: """A per-class object that serves class- and object-specific results. This is used by :class:`.AssociationProxy` when it is invoked @@ -936,7 +936,7 @@ class ColumnAssociationProxyInstance( ) -class _lazy_collection(object): +class _lazy_collection: def __init__(self, obj, target): self.parent = obj self.target = target @@ -952,7 +952,7 @@ class _lazy_collection(object): self.target = state["target"] -class _AssociationCollection(object): +class _AssociationCollection: def __init__(self, lazy_collection, creator, getter, setter, parent): """Constructs an _AssociationCollection. diff --git a/lib/sqlalchemy/ext/automap.py b/lib/sqlalchemy/ext/automap.py index 7cb2c4400..b62c514c7 100644 --- a/lib/sqlalchemy/ext/automap.py +++ b/lib/sqlalchemy/ext/automap.py @@ -717,7 +717,7 @@ def generate_relationship( raise TypeError("Unknown relationship function: %s" % return_fn) -class AutomapBase(object): +class AutomapBase: """Base class for an "automap" schema. The :class:`.AutomapBase` class can be compared to the "declarative base" diff --git a/lib/sqlalchemy/ext/baked.py b/lib/sqlalchemy/ext/baked.py index 61328fce9..efdafff96 100644 --- a/lib/sqlalchemy/ext/baked.py +++ b/lib/sqlalchemy/ext/baked.py @@ -30,7 +30,7 @@ from ..util import collections_abc log = logging.getLogger(__name__) -class Bakery(object): +class Bakery: """Callable which returns a :class:`.BakedQuery`. This object is returned by the class method @@ -52,7 +52,7 @@ class Bakery(object): return self.cls(self.cache, initial_fn, args) -class BakedQuery(object): +class BakedQuery: """A builder object for :class:`.query.Query` objects.""" __slots__ = "steps", "_bakery", "_cache_key", "_spoiled" @@ -309,7 +309,7 @@ class BakedQuery(object): return query -class Result(object): +class Result: """Invokes a :class:`.BakedQuery` against a :class:`.Session`. The :class:`_baked.Result` object is where the actual :class:`.query.Query` diff --git a/lib/sqlalchemy/ext/compiler.py b/lib/sqlalchemy/ext/compiler.py index 354b0ca4a..d961e2c81 100644 --- a/lib/sqlalchemy/ext/compiler.py +++ b/lib/sqlalchemy/ext/compiler.py @@ -416,7 +416,7 @@ def deregister(class_): del class_._compiler_dispatcher -class _dispatcher(object): +class _dispatcher: def __init__(self): self.specs = {} diff --git a/lib/sqlalchemy/ext/declarative/extensions.py b/lib/sqlalchemy/ext/declarative/extensions.py index 1a12b1205..1862592f5 100644 --- a/lib/sqlalchemy/ext/declarative/extensions.py +++ b/lib/sqlalchemy/ext/declarative/extensions.py @@ -37,7 +37,7 @@ def instrument_declarative(cls, cls_registry, metadata): ) -class ConcreteBase(object): +class ConcreteBase: """A helper class for 'concrete' declarative mappings. :class:`.ConcreteBase` will use the :func:`.polymorphic_union` @@ -315,7 +315,7 @@ class AbstractConcreteBase(ConcreteBase): ) -class DeferredReflection(object): +class DeferredReflection: """A helper class for construction of mappings based on a deferred reflection step. diff --git a/lib/sqlalchemy/ext/hybrid.py b/lib/sqlalchemy/ext/hybrid.py index eab3f2b73..67c42cde6 100644 --- a/lib/sqlalchemy/ext/hybrid.py +++ b/lib/sqlalchemy/ext/hybrid.py @@ -137,7 +137,7 @@ usage of the absolute value function:: from sqlalchemy import func - class Interval(object): + class Interval: # ... @hybrid_property @@ -166,7 +166,7 @@ object for class-level expressions:: the new hybrid with the additional state will be attached to the class with the non-matching name. To use the example above:: - class Interval(object): + class Interval: # ... @hybrid_property @@ -189,7 +189,7 @@ Defining Setters Hybrid properties can also define setter methods. If we wanted ``length`` above, when set, to modify the endpoint value:: - class Interval(object): + class Interval: # ... @hybrid_property @@ -231,7 +231,7 @@ accommodate a value passed to :meth:`_query.Query.update` which can affect this, using the :meth:`.hybrid_property.update_expression` decorator. A handler that works similarly to our setter would be:: - class Interval(object): + class Interval: # ... @hybrid_property @@ -267,7 +267,7 @@ above. of the hybrid must match that of how it is accessed. Something like this wouldn't work:: - class Interval(object): + class Interval: # ... def _get(self): @@ -849,7 +849,7 @@ class hybrid_method(interfaces.InspectionAttrInfo): from sqlalchemy.ext.hybrid import hybrid_method - class SomeClass(object): + class SomeClass: @hybrid_method def value(self, x, y): return self._value + x + y @@ -902,7 +902,7 @@ class hybrid_property(interfaces.InspectionAttrInfo): from sqlalchemy.ext.hybrid import hybrid_property - class SomeClass(object): + class SomeClass: @hybrid_property def value(self): return self._value @@ -958,7 +958,7 @@ class hybrid_property(interfaces.InspectionAttrInfo): to be used without conflicting with the same-named attributes normally present on the :class:`.QueryableAttribute`:: - class SuperClass(object): + class SuperClass: # ... @hybrid_property diff --git a/lib/sqlalchemy/ext/instrumentation.py b/lib/sqlalchemy/ext/instrumentation.py index 54f3e64c5..72448fbdc 100644 --- a/lib/sqlalchemy/ext/instrumentation.py +++ b/lib/sqlalchemy/ext/instrumentation.py @@ -193,7 +193,7 @@ orm_instrumentation._instrumentation_factory = ( orm_instrumentation.instrumentation_finders = instrumentation_finders -class InstrumentationManager(object): +class InstrumentationManager: """User-defined class instrumentation extension. :class:`.InstrumentationManager` can be subclassed in order diff --git a/lib/sqlalchemy/ext/mutable.py b/lib/sqlalchemy/ext/mutable.py index 4eed3b2af..7e277d379 100644 --- a/lib/sqlalchemy/ext/mutable.py +++ b/lib/sqlalchemy/ext/mutable.py @@ -113,7 +113,7 @@ mapping against the ``my_data`` table:: from sqlalchemy import mapper - class MyDataClass(object): + class MyDataClass: pass # associates mutation listeners with MyDataClass.data @@ -286,7 +286,7 @@ objects to each of the ``Vertex.start`` and ``Vertex.end`` attributes:: Column('y2', Integer), ) - class Vertex(object): + class Vertex: pass mapper(Vertex, vertices, properties={ @@ -366,7 +366,7 @@ from ..sql.base import SchemaEventTarget from ..util import memoized_property -class MutableBase(object): +class MutableBase: """Common base class to :class:`.Mutable` and :class:`.MutableComposite`. |