]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Resolve RST306 issues
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 13 May 2019 15:52:17 +0000 (11:52 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 13 May 2019 22:40:55 +0000 (18:40 -0400)
The latest flake8 seems to look for these and they are in fact
correctable with a backslash.  Also need to add r to the strings
to avoid W605.

Change-Id: I8045309aa2ad29978ba7e99c45f75bc1457dff3d
(cherry picked from commit 663ed1a0772f6c6d53b1f4f9a2f652d0e5ce0b8a)

examples/custom_attributes/active_column_defaults.py
lib/sqlalchemy/ext/associationproxy.py
lib/sqlalchemy/orm/events.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/session.py

index f05a53173ad49edc9cc775e49e0884723a0aee59..dea79ee952fd1781a4f7c8a831555f8b8eda5974 100644 (file)
@@ -28,7 +28,7 @@ def configure_listener(mapper, class_):
 def default_listener(col_attr, default):
     """Establish a default-setting listener.
 
-    Given a class_, attrname, and a :class:`.DefaultGenerator` instance.
+    Given a class attribute and a :class:`.DefaultGenerator` instance.
     The default generator should be a :class:`.ColumnDefault` object with a
     plain Python value or callable default; otherwise, the appropriate behavior
     for SQL functions and defaults should be determined here by the
index 2e057fc020542369ab45bf8c94de792a9b79ed39..c725372c5c00e75758aa744090380a4d33fc9669 100644 (file)
@@ -206,7 +206,7 @@ class AssociationProxy(interfaces.InspectionAttrInfo):
         return self._as_instance(class_, obj).delete(obj)
 
     def for_class(self, class_, obj=None):
-        """Return the internal state local to a specific mapped class.
+        r"""Return the internal state local to a specific mapped class.
 
         E.g., given a class ``User``::
 
@@ -225,7 +225,7 @@ class AssociationProxy(interfaces.InspectionAttrInfo):
         is specific to the ``User`` class.   The :class:`.AssociationProxy`
         object remains agnostic of its parent class.
 
-        :param class_: the class that we are returning state for.
+        :param class\_: the class that we are returning state for.
 
         :param obj: optional, an instance of the class that is required
          if the attribute refers to a polymorphic target, e.g. where we have
index b9bad10b6c6af3568fdc14f9592799d851141070..88d3122371e0640f59ec983e6e4e9224172e3948 100644 (file)
@@ -2114,7 +2114,7 @@ class AttributeEvents(event.Events):
         """
 
     def init_scalar(self, target, value, dict_):
-        """Receive a scalar "init" event.
+        r"""Receive a scalar "init" event.
 
         This event is invoked when an uninitialized, unpersisted scalar
         attribute is accessed, e.g. read::
@@ -2212,7 +2212,7 @@ class AttributeEvents(event.Events):
          listener were invoked.  This value begins as the value ``None``,
          however will be the return value of the previous event handler
          function if multiple listeners are present.
-        :param dict_: the attribute dictionary of this mapped object.
+        :param dict\_: the attribute dictionary of this mapped object.
          This is normally the ``__dict__`` of the object, but in all cases
          represents the destination that the attribute system uses to get
          at the actual value of this attribute.  Placing the value in this
index 9909724d3c9c1db0c3a3620c53f1e0a663033f6b..6eadffb16030d36efd2f09e95a1e23b8a6cf6785 100644 (file)
@@ -1244,9 +1244,9 @@ class Mapper(InspectionAttr):
     def _configure_class_instrumentation(self):
         """If this mapper is to be a primary mapper (i.e. the
         non_primary flag is not set), associate this Mapper with the
-        given class_ and entity name.
+        given class and entity name.
 
-        Subsequent calls to ``class_mapper()`` for the class_/entity
+        Subsequent calls to ``class_mapper()`` for the ``class_`` / ``entity``
         name combination will return this mapper.  Also decorate the
         `__init__` method on the mapped class to include optional
         auto-session attachment logic.
@@ -2986,10 +2986,10 @@ class Mapper(InspectionAttr):
         return self._subclass_load_via_in(self)
 
     def cascade_iterator(self, type_, state, halt_on=None):
-        """Iterate each element and its mapper in an object graph,
+        r"""Iterate each element and its mapper in an object graph,
         for all relationships that meet the given cascade rule.
 
-        :param type_:
+        :param type\_:
           The name of the cascade rule (i.e. ``"save-update"``, ``"delete"``,
           etc.).
 
index eccd60fe2ad3ce4f5fbf176a363568b1f1229b02..517fc2b36b801dafdcab774cc763809ae7fc3fa7 100644 (file)
@@ -3162,7 +3162,7 @@ class sessionmaker(_SessionClassMethods):
 
         :param bind: a :class:`.Engine` or other :class:`.Connectable` with
          which newly created :class:`.Session` objects will be associated.
-        :param class_: class to use in order to create new :class:`.Session`
+        :param class\_: class to use in order to create new :class:`.Session`
          objects.  Defaults to :class:`.Session`.
         :param autoflush: The autoflush setting to use with newly created
          :class:`.Session` objects.