From: Mike Bayer Date: Mon, 13 May 2019 15:52:17 +0000 (-0400) Subject: Resolve RST306 issues X-Git-Tag: rel_1_4_0b1~877^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=663ed1a0772f6c6d53b1f4f9a2f652d0e5ce0b8a;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Resolve RST306 issues 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 --- diff --git a/examples/custom_attributes/active_column_defaults.py b/examples/custom_attributes/active_column_defaults.py index f05a53173a..dea79ee952 100644 --- a/examples/custom_attributes/active_column_defaults.py +++ b/examples/custom_attributes/active_column_defaults.py @@ -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 diff --git a/lib/sqlalchemy/ext/associationproxy.py b/lib/sqlalchemy/ext/associationproxy.py index 2e057fc020..c725372c5c 100644 --- a/lib/sqlalchemy/ext/associationproxy.py +++ b/lib/sqlalchemy/ext/associationproxy.py @@ -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 diff --git a/lib/sqlalchemy/orm/events.py b/lib/sqlalchemy/orm/events.py index b9bad10b6c..88d3122371 100644 --- a/lib/sqlalchemy/orm/events.py +++ b/lib/sqlalchemy/orm/events.py @@ -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 diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 9909724d3c..6eadffb160 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -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.). diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index eccd60fe2a..517fc2b36b 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -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.