]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix a wide variety of typos and broken links
authoraplatkouski <5857672+aplatkouski@users.noreply.github.com>
Thu, 25 Jun 2020 20:38:06 +0000 (16:38 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 25 Jun 2020 22:51:50 +0000 (18:51 -0400)
Cherry pick from I9c36e8d8804483950db4b42c38ee456e384c59e3

Signed-off-by: aplatkouski <5857672+aplatkouski@users.noreply.github.com>
Closes: #5416
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5416
Pull-request-sha: 8b742b67285d1fc16323cc23f63d539a6a9ae62e

Change-Id: I85985199858ec881eaea98fc190d12b459aeb733

72 files changed:
doc/build/changelog/changelog_08.rst
doc/build/changelog/changelog_10.rst
doc/build/changelog/changelog_11.rst
doc/build/changelog/changelog_12.rst
doc/build/changelog/changelog_13.rst
doc/build/changelog/migration_13.rst
doc/build/core/connections.rst
doc/build/core/constraints.rst
doc/build/core/custom_types.rst
doc/build/core/ddl.rst
doc/build/core/defaults.rst
doc/build/core/internals.rst
doc/build/core/sqlelement.rst
doc/build/core/tutorial.rst
doc/build/core/type_api.rst
doc/build/faq/sessions.rst
doc/build/glossary.rst
doc/build/orm/backref.rst
doc/build/orm/extensions/declarative/api.rst
doc/build/orm/extensions/declarative/relationships.rst
doc/build/orm/inheritance_loading.rst
doc/build/orm/internals.rst
doc/build/orm/nonstandard_mappings.rst
doc/build/orm/persistence_techniques.rst
doc/build/orm/session_basics.rst
doc/build/orm/session_transaction.rst
doc/build/orm/tutorial.rst
lib/sqlalchemy/dialects/mssql/provision.py
lib/sqlalchemy/dialects/oracle/cx_oracle.py
lib/sqlalchemy/dialects/postgresql/json.py
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/engine/interfaces.py
lib/sqlalchemy/engine/reflection.py
lib/sqlalchemy/engine/result.py
lib/sqlalchemy/engine/url.py
lib/sqlalchemy/event/api.py
lib/sqlalchemy/event/base.py
lib/sqlalchemy/ext/associationproxy.py
lib/sqlalchemy/ext/declarative/api.py
lib/sqlalchemy/ext/declarative/clsregistry.py
lib/sqlalchemy/ext/horizontal_shard.py
lib/sqlalchemy/ext/hybrid.py
lib/sqlalchemy/ext/instrumentation.py
lib/sqlalchemy/orm/base.py
lib/sqlalchemy/orm/dynamic.py
lib/sqlalchemy/orm/instrumentation.py
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/orm/state.py
lib/sqlalchemy/orm/unitofwork.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/ddl.py
lib/sqlalchemy/sql/dml.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/functions.py
lib/sqlalchemy/sql/operators.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/sql/type_api.py
lib/sqlalchemy/sql/visitors.py
lib/sqlalchemy/testing/plugin/pytestplugin.py
lib/sqlalchemy/testing/profiling.py
test/ext/test_automap.py
test/orm/test_assorted_eager.py
test/orm/test_bind.py
test/orm/test_deprecations.py
test/sql/test_functions.py

index fbd7b837fbe9f5b53968eeb5c5f44f5b4211e41d..d0b49a05061647a1b417ceeda4fb70cef55cd338 100644 (file)
         :tickets: 2957
         :versions: 0.9.3
 
-        Fixed bug where :meth:`.ColumnOperators.in_()` would go into an endless
+        Fixed bug where :meth:`.ColumnOperators.in_` would go into an endless
         loop if erroneously passed a column expression whose comparator
         included the ``__getitem__()`` method, such as a column that uses the
         :class:`_postgresql.ARRAY` type.
index f4e012c23096c23b564f85bedb0ee84520054e4e..7058a2ae2350d02c139ab57f449641d16466fec2 100644 (file)
         to a modern pool invalidation in that connections aren't actively
         closed, but are recycled only on next checkout; this is essentially
         a per-connection version of that feature.  A new event
-        :class:`_events.PoolEvents.soft_invalidate` is added to complement it.
+        :meth:`_events.PoolEvents.soft_invalidate` is added to complement it.
 
         Also added new flag
         :attr:`.ExceptionContext.invalidate_pool_on_disconnect`.
index d8234488a029d2072da35cf75d2d91adc3037e9d..013efce38585997ff34782894e90186af528fc6f 100644 (file)
     :version: 1.1.15
     :released: November 3, 2017
 
-    .. change:
+    .. change::
         :tags: bug, sqlite
         :tickets: 4099
         :versions: 1.2.0b3
         for single inheritance discriminator criteria inappropriately re-applying
         the criteria to the outer query.
 
-    .. change:
+    .. change::
         :tags: bug, mysql
         :tickets: 4096
         :versions: 1.2.0b3
         in the MariaDB 10.2 series due to a syntax change, where the function
         is now represented as ``current_timestamp()``.
 
-    .. change:
+    .. change::
         :tags: bug, mysql
         :tickets: 4098
         :versions: 1.2.0b3
index 8c138bde8f5c127a4d25cedac363b04b0e3cb00c..38f6fd5fa565c55c8cf0aa6f6bd8510c1c221260 100644 (file)
         Fixed bug in cache key generation for baked queries which could cause a
         too-short cache key to be generated for the case of eager loads across
         subclasses.  This could in turn cause the eagerload query to be cached in
-        place of a non-eagerload query, or vice versa, for a polymorhic "selectin"
+        place of a non-eagerload query, or vice versa, for a polymorphic "selectin"
         load, or possibly for lazy loads or selectin loads as well.
 
     .. change::
index bf0190dede5aaa9a11cc0d6d36ad02a73a311a72..1118e043aa1caac378157bf0e668fab66aaab96a 100644 (file)
         Fixed issue where an :class:`.Index` that is deferred in being associated
         with a table, such as as when it contains a :class:`.Column` that is not
         associated with any :class:`.Table` yet,  would fail to attach correctly if
-        it also contained a non table-oriented expession.
+        it also contained a non table-oriented expression.
 
 
     .. change::
         :tags: bug, mysql
         :tickets: 5239
 
-        Fixed issue in MySQL dialect when connecting to a psuedo-MySQL database
+        Fixed issue in MySQL dialect when connecting to a pseudo-MySQL database
         such as that provided by ProxySQL, the up front check for isolation level
         when it returns no row will not prevent the dialect from continuing to
         connect. A warning is emitted that the isolation level could not be
index 490cb1066e53070dd44219e26c93a57836e10b2d..99a6e843bef9ac1fa76f8f683c7080474210c2ef 100644 (file)
@@ -886,7 +886,7 @@ FOR UPDATE clause is rendered within the joined eager load subquery as well as o
 
 This change applies specifically to the use of the :func:`_orm.joinedload` loading
 strategy in conjunction with a row limited query, e.g. using :meth:`_query.Query.first`
-or :meth:`_query.Query.limit`, as well as with use of the :class:`_query.Query.with_for_update` method.
+or :meth:`_query.Query.limit`, as well as with use of the :meth:`_query.Query.with_for_update` method.
 
 Given a query as::
 
index 229d942a10e29913881a69cfdfd6b9f0f422d190..99f84d9acb86ea13284699f1b4e03a29d09ead3c 100644 (file)
@@ -23,7 +23,7 @@ the :func:`_sa.create_engine` call::
 
     engine = create_engine('mysql://scott:tiger@localhost/test')
 
-The typical usage of :func:`_sa.create_engine()` is once per particular database
+The typical usage of :func:`_sa.create_engine` is once per particular database
 URL, held globally for the lifetime of a single application process. A single
 :class:`_engine.Engine` manages many individual :term:`DBAPI` connections on behalf of
 the process and is intended to be called upon in a concurrent fashion. The
@@ -39,7 +39,6 @@ per-object or per-function call.
     engine is initialized per process.  See :ref:`pooling_multiprocessing` for
     details.
 
-
 The most basic function of the :class:`_engine.Engine` is to provide access to a
 :class:`_engine.Connection`, which can then invoke SQL statements.   To emit
 a textual statement to the database looks like::
@@ -215,6 +214,7 @@ it so that a SELECT statement will issue a COMMIT::
 
 .. _dbengine_implicit:
 
+
 Connectionless Execution, Implicit Execution
 ============================================
 
@@ -224,8 +224,8 @@ Connectionless Execution, Implicit Execution
 Recall from the first section we mentioned executing with and without explicit
 usage of :class:`_engine.Connection`. "Connectionless" execution
 refers to the usage of the ``execute()`` method on an object which is not a
-:class:`_engine.Connection`.  This was illustrated using the :meth:`_engine.Engine.execute` method
-of :class:`_engine.Engine`::
+:class:`_engine.Connection`.  This was illustrated using the
+:meth:`_engine.Engine.execute` method of :class:`_engine.Engine`::
 
     result = engine.execute("select username from users")
     for row in result:
index 4abe7709d721457d60fe4bc23fa65c8987f976e3..3e1eaabad42c66d4de1b43aeeb60d28239743545 100644 (file)
@@ -249,7 +249,7 @@ like the following is generated::
 .. versionchanged:: 1.0.0 - The DDL system invoked by
    :meth:`_schema.MetaData.create_all`
    and :meth:`_schema.MetaData.drop_all` will now automatically resolve mutually
-   depdendent foreign keys between tables declared by
+   dependent foreign keys between tables declared by
    :class:`_schema.ForeignKeyConstraint` and :class:`_schema.ForeignKey` objects, without
    the need to explicitly set the :paramref:`_schema.ForeignKeyConstraint.use_alter`
    flag.
index 740d1593f3ff9049ede08bc157c8662cd1de348d..c9970872da0e143792d94873ae1d496d56e4f88c 100644 (file)
@@ -473,7 +473,7 @@ Redefining and Creating New Operators
 -------------------------------------
 
 SQLAlchemy Core defines a fixed set of expression operators available to all column expressions.
-Some of these operations have the effect of overloading Python's built in operators;
+Some of these operations have the effect of overloading Python's built-in operators;
 examples of such operators include
 :meth:`.ColumnOperators.__eq__` (``table.c.somecolumn == 'foo'``),
 :meth:`.ColumnOperators.__invert__` (``~table.c.flag``),
@@ -484,7 +484,7 @@ explicit methods on column expressions, such as
 
 The Core expression constructs in all cases consult the type of the expression in order to determine
 the behavior of existing operators, as well as to locate additional operators that aren't part of
-the built in set.   The :class:`.TypeEngine` base class defines a root "comparison" implementation
+the built-in set.   The :class:`.TypeEngine` base class defines a root "comparison" implementation
 :class:`.TypeEngine.Comparator`, and many specific types provide their own sub-implementations of this
 class.   User-defined :class:`.TypeEngine.Comparator` implementations can be built directly into a
 simple subclass of a particular type in order to override or define new operations.  Below,
index f38dcf849c7880f2b7131864de614758137e3cba..30619a419a24706a1d5c802d9be1816846d72484 100644 (file)
@@ -140,7 +140,7 @@ provide DDL expressions. For example, to produce a ``CREATE TABLE`` statement:
 .. sourcecode:: python+sql
 
     from sqlalchemy.schema import CreateTable
-    with engine.connecT() as conn:
+    with engine.connect() as conn:
     {sql}    conn.execute(CreateTable(mytable))
     CREATE TABLE mytable (
         col1 INTEGER,
index a691655cced497fbb0fca4cb6be84b1d9495f8f9..4d26fc0ef01215f2dd367246df4d7594e91659b5 100644 (file)
@@ -152,8 +152,8 @@ otherwise not provided, and the value will be that of whatever value is present
 in the execution for the ``counter`` column, plus the number 12.
 
 For a single statement that is being executed using "executemany" style, e.g.
-with multiple parameter sets passed to :meth:`_engine.Connection.execute`, the user-
-defined function is called once for each set of parameters. For the use case of
+with multiple parameter sets passed to :meth:`_engine.Connection.execute`, the
+user-defined function is called once for each set of parameters. For the use case of
 a multi-valued :class:`_expression.Insert` construct (e.g. with more than one VALUES
 clause set up via the :meth:`_expression.Insert.values` method), the user-defined function
 is also called once for each set of parameters.
@@ -242,8 +242,8 @@ all Python and SQL expressions which were pre-executed, are present in the
 :meth:`_engine.ResultProxy.last_updated_params` collections on
 :class:`~sqlalchemy.engine.ResultProxy`. The
 :attr:`_engine.ResultProxy.inserted_primary_key` collection contains a list of primary
-key values for the row inserted (a list so that single-column and composite-
-column primary keys are represented in the same format).
+key values for the row inserted (a list so that single-column and
+composite-column primary keys are represented in the same format).
 
 .. _server_defaults:
 
@@ -322,10 +322,10 @@ Defining Sequences
 
 SQLAlchemy represents database sequences using the
 :class:`~sqlalchemy.schema.Sequence` object, which is considered to be a
-special case of "column default". It only has an effect on databases which
-have explicit support for sequences, which currently includes PostgreSQL,
-Oracle, and Firebird. The :class:`~sqlalchemy.schema.Sequence` object is
-otherwise ignored.
+special case of "column default". It only has an effect on databases which have
+explicit support for sequences, which currently includes PostgreSQL, Oracle,
+MariaDB 10.3 or greater, and Firebird. The :class:`~sqlalchemy.schema.Sequence`
+object is otherwise ignored.
 
 The :class:`~sqlalchemy.schema.Sequence` may be placed on any column as a
 "default" generator to be used during INSERT operations, and can also be
@@ -370,7 +370,7 @@ Associating a Sequence on a SERIAL column
 PostgreSQL's SERIAL datatype is an auto-incrementing type that implies
 the implicit creation of a PostgreSQL sequence when CREATE TABLE is emitted.
 If a :class:`_schema.Column` specifies an explicit :class:`.Sequence` object
-which also specifies a true value for the :paramref:`.Sequence.optional`
+which also specifies a ``True`` value for the :paramref:`.Sequence.optional`
 boolean flag, the :class:`.Sequence` will not take effect under PostgreSQL,
 and the SERIAL datatype will proceed normally.   Instead, the :class:`.Sequence`
 will only take effect when used against other sequence-supporting
index e5a710011ad7949775b6edb0b7d0864723f7a7af..965c03fd9ff2e0c9599df44814d41bd711964a71 100644 (file)
@@ -5,7 +5,7 @@ Core Internals
 
 Some key internal constructs are listed here.
 
-.. currentmodule: sqlalchemy
+.. currentmodule:: sqlalchemy
 
 .. autoclass:: sqlalchemy.engine.interfaces.Compiled
     :members:
index daf2ada2f62ed787b4f42081c8c7694431b3ffec..ea39cfb6e912f6f9a34415016d124eeeb2420e79 100644 (file)
@@ -7,12 +7,12 @@ The expression API consists of a series of classes each of which represents a
 specific lexical element within a SQL string.  Composed together
 into a larger structure, they form a statement construct that may
 be *compiled* into a string representation that can be passed to a database.
-The classes are organized into a
-hierarchy that begins at the basemost ClauseElement class. Key subclasses
-include ColumnElement, which represents the role of any column-based expression
+The classes are organized into a hierarchy that begins at the basemost
+:class:`.ClauseElement` class. Key subclasses include :class:`.ColumnElement`,
+which represents the role of any column-based expression
 in a SQL statement, such as in the columns clause, WHERE clause, and ORDER BY
-clause, and FromClause, which represents the role of a token that is placed in
-the FROM clause of a SELECT statement.
+clause, and :class:`.FromClause`, which represents the role of a token that
+is placed in the FROM clause of a SELECT statement.
 
 .. autofunction:: all_
 
index 7da8ea8778dc37ec8bc1e94ef0e2869214ee65f5..0ee480677c6f595374ef139981e028c2500f5800 100644 (file)
@@ -250,8 +250,8 @@ The interesting part of an :class:`~sqlalchemy.sql.expression.Insert` is
 executing it. In this tutorial, we will generally focus on the most explicit
 method of executing a SQL construct, and later touch upon some "shortcut" ways
 to do it. The ``engine`` object we created is a repository for database
-connections capable of issuing SQL to the database. To acquire a connection,
-we use the ``connect()`` method::
+connections capable of issuing SQL to the database. To acquire a
+connection, we will use the :meth:`.Engine.connect` method::
 
     >>> conn = engine.connect()
     >>> conn
@@ -900,8 +900,8 @@ Fetching the ``email_address`` column would be::
     >>> row[addresses.c.email_address]
     'jack@yahoo.com'
 
-If on the other hand we used a string column key, the usual rules of name-
-based matching still apply, and we'd get an ambiguous column error for
+If on the other hand we used a string column key, the usual rules of
+name-based matching still apply, and we'd get an ambiguous column error for
 the ``id`` value::
 
     >>> row["id"]
@@ -2235,8 +2235,8 @@ method as Python dictionary keys, there is no other fixed ordering
 available.
 
 However in some cases, the order of parameters rendered in the SET clause of an
-UPDATE statement can be significant.  The main example of this is when using
-MySQL and providing updates to column values based on that of other
+UPDATE statement may need to be explicitly stated.  The main example of this is
+when using MySQL and providing updates to column values based on that of other
 column values.  The end result of the following statement::
 
     UPDATE some_table SET x = y + 10, y = 20
index 115cbd202f210469dbfc49ce7c739f7c797dd1e8..0dd1b492053063c6029f7fb45669ea94e59bb1b9 100644 (file)
@@ -20,5 +20,4 @@ Base Type API
 
 
 .. autoclass:: Variant
-
    :members: with_variant, __init__
index 76cabf765358bdba986c0edea023a12dcc0a4623..835ce301ff321b900510613aefd985873c3e96c2 100644 (file)
@@ -198,7 +198,7 @@ This transaction is "logical" in that it does not actually use any  database
 resources until a SQL statement is invoked, at which point a connection-level
 and DBAPI-level transaction is started.   However, whether or not
 database-level transactions are part of its state, the logical transaction will
-stay in place until it is ended using :meth:`.Session.commit()`,
+stay in place until it is ended using :meth:`.Session.commit`,
 :meth:`.Session.rollback`, or :meth:`.Session.close`.
 
 When the ``flush()`` above fails, the code is still within the transaction
index f0cb23d42db9c76946c216e141f22d272b904a4b..cec9ebf307a79049d2230df23bbcfd3ad377a8b4 100644 (file)
@@ -12,7 +12,7 @@ Glossary
     relational
     relational algebra
 
-        An algrebraic system developed by Edgar F. Codd that is used for
+        An algebraic system developed by Edgar F. Codd that is used for
         modelling and querying the data stored in relational databases.
 
         .. seealso::
@@ -23,7 +23,7 @@ Glossary
         A term used in SQLAlchemy to describe a SQL construct that represents
         a collection of rows.   It's largely similar to the concept of a
         "relation" in :term:`relational algebra`.  In SQLAlchemy, objects
-        that subclass the :class:`expression.Selectable` class are considered to be
+        that subclass the :class:`_expression.Selectable` class are considered to be
         usable as "selectables" when using SQLAlchemy Core.  The two most
         common constructs are that of the :class:`_schema.Table` and that of the
         :class:`_expression.Select` statement.
@@ -50,6 +50,7 @@ Glossary
         within the join expression.
 
     crud
+    CRUD
         An acronym meaning "Create, Update, Delete".  The term in SQL refers to the
         set of operations that create, modify and delete data from the database,
         also known as :term:`DML`, and typically refers to the ``INSERT``,
@@ -131,7 +132,7 @@ Glossary
        An acronym for **Data Manipulation Language**.  DML is the subset of
        SQL that relational databases use to *modify* the data in tables. DML
        typically refers to the three widely familiar statements of INSERT,
-       UPDATE and  DELETE, otherwise known as :term:`CRUD` (acronoym for "CReate,
+       UPDATE and  DELETE, otherwise known as :term:`CRUD` (acronym for "CReate,
        Update, Delete").
 
         .. seealso::
@@ -206,7 +207,7 @@ Glossary
         In SQLAlchemy, the "dialect" is a Python object that represents information
         and methods that allow database operations to proceed on a particular
         kind of database backend and a particular kind of Python driver (or
-        :term`DBAPI`) for that database.   SQLAlchemy dialects are subclasses
+        :term:`DBAPI`) for that database.   SQLAlchemy dialects are subclasses
         of the :class:`.Dialect` class.
 
         .. seealso::
@@ -239,7 +240,7 @@ Glossary
     identity map
         A mapping between Python objects and their database identities.
         The identity map is a collection that's associated with an
-        ORM :term:`session` object, and maintains a single instance
+        ORM :term:`Session` object, and maintains a single instance
         of every database object keyed to its identity.   The advantage
         to this pattern is that all operations which occur for a particular
         database identity are transparently coordinated onto a single
@@ -412,7 +413,7 @@ Glossary
 
         .. seealso::
 
-               :ref:`pooling_toplevel`
+            :ref:`pooling_toplevel`
 
     DBAPI
         DBAPI is shorthand for the phrase "Python Database API
@@ -461,6 +462,7 @@ Glossary
     expire
     expires
     expiring
+    Expiring
         In the SQLAlchemy ORM, refers to when the data in a :term:`persistent`
         or sometimes :term:`detached` object is erased, such that when
         the object's attributes are next accessed, a :term:`lazy load` SQL
@@ -682,6 +684,7 @@ Glossary
 
     isolation
     isolated
+    Isolation
     isolation level
         The isolation property of the :term:`ACID` model
         ensures that the concurrent execution
@@ -1226,7 +1229,7 @@ Glossary
 
     transient
         This describes one of the major object states which
-        an object can have within a :term:`session`; a transient object
+        an object can have within a :term:`Session`; a transient object
         is a new object that doesn't have any database identity
         and has not been associated with a session yet.  When the
         object is added to the session, it moves to the
@@ -1238,7 +1241,7 @@ Glossary
 
     pending
         This describes one of the major object states which
-        an object can have within a :term:`session`; a pending object
+        an object can have within a :term:`Session`; a pending object
         is a new object that doesn't have any database identity,
         but has been recently associated with a session.   When
         the session emits a flush and the row is inserted, the
@@ -1250,7 +1253,7 @@ Glossary
 
     deleted
         This describes one of the major object states which
-        an object can have within a :term:`session`; a deleted object
+        an object can have within a :term:`Session`; a deleted object
         is an object that was formerly persistent and has had a
         DELETE statement emitted to the database within a flush
         to delete its row.  The object will move to the :term:`detached`
@@ -1265,7 +1268,7 @@ Glossary
 
     persistent
         This describes one of the major object states which
-        an object can have within a :term:`session`; a persistent object
+        an object can have within a :term:`Session`; a persistent object
         is an object that has a database identity (i.e. a primary key)
         and is currently associated with a session.   Any object
         that was previously :term:`pending` and has now been inserted
@@ -1280,7 +1283,7 @@ Glossary
 
     detached
         This describes one of the major object states which
-        an object can have within a :term:`session`; a detached object
+        an object can have within a :term:`Session`; a detached object
         is an object that has a database identity (i.e. a primary key)
         but is not associated with any session.  An object that
         was previously :term:`persistent` and was removed from its
index 80b395930bf71ab69b67bf5f9ec3b0808688198c..65d19eb185c80edb1e38df0620f2678942dbbb36 100644 (file)
@@ -216,7 +216,7 @@ However, if we instead created a new ``Address`` object, and associated the
 In the above example, it is **not** as intuitive that the ``Address`` would
 automatically be added to the :class:`.Session`.  However, the backref behavior
 of ``Address.user`` indicates that the ``Address`` object is also appended to
-the ``User.addresses`` collection.  This in turn intiates a **cascade**
+the ``User.addresses`` collection.  This in turn initiates a **cascade**
 operation which indicates that this ``Address`` should be placed into the
 :class:`.Session` as a :term:`pending` object.
 
@@ -228,7 +228,7 @@ to False, as in::
     class User(Base):
         # ...
 
-        addresses = relationship("Address", back_populates="user", cascade_backefs=False)
+        addresses = relationship("Address", back_populates="user", cascade_backrefs=False)
 
 See the example in :ref:`backref_cascade` for further information.
 
index f55f2911f25e4a4a7b5c93feb07de839fc10351e..445334a4d1647b7efba26a7b78910e8f6d6e0dd2 100644 (file)
@@ -105,7 +105,7 @@ Above, classes which inherit from ``DefaultBase`` will use one
 created perhaps within distinct databases::
 
     DefaultBase.metadata.create_all(some_engine)
-    OtherBase.metadata_create_all(some_other_engine)
+    OtherBase.metadata.create_all(some_other_engine)
 
 
 ``__table_cls__``
index d33d44245444cf6f15344829801cc4eac06548ad..ac2671c52e07183011fd92299eaf8b305efe211a 100644 (file)
@@ -152,8 +152,8 @@ with declarative as with traditional mappings. The
 traditional way.  The :class:`_schema.Table` usually shares
 the :class:`_schema.MetaData` object used by the declarative base::
 
-    keywords = Table(
-        'keywords', Base.metadata,
+    keyword_author = Table(
+        'keyword_author', Base.metadata,
         Column('author_id', Integer, ForeignKey('authors.id')),
         Column('keyword_id', Integer, ForeignKey('keywords.id'))
         )
@@ -161,7 +161,7 @@ the :class:`_schema.MetaData` object used by the declarative base::
     class Author(Base):
         __tablename__ = 'authors'
         id = Column(Integer, primary_key=True)
-        keywords = relationship("Keyword", secondary=keywords)
+        keywords = relationship("Keyword", secondary=keyword_author)
 
 Like other :func:`~sqlalchemy.orm.relationship` arguments, a string is accepted
 as well, passing the string name of the table as defined in the
@@ -170,7 +170,7 @@ as well, passing the string name of the table as defined in the
     class Author(Base):
         __tablename__ = 'authors'
         id = Column(Integer, primary_key=True)
-        keywords = relationship("Keyword", secondary="keywords")
+        keywords = relationship("Keyword", secondary="keyword_author")
 
 As with traditional mapping, its generally not a good idea to use
 a :class:`_schema.Table` as the "secondary" argument which is also mapped to
index 7e5675c1467afcdf954037cca5b00b9ef393eec6..3ddff01cfbb5230c83dc3f9e26e062f575a50c16 100644 (file)
@@ -541,7 +541,7 @@ similarly to the following:
     WHERE employee.id IN (?) ORDER BY employee.id
     (1,)
 
-Combining "selectin" polymorhic loading with query-time
+Combining "selectin" polymorphic loading with query-time
 :func:`_orm.with_polymorphic` usage is also possible (though this is very
 outer-space stuff!); assuming the above mappings had no ``polymorphic_load``
 set up, we could get the same result as follows::
index 3194e90f46356403e59a1287b35f4a6ce00b905e..844ddedb50066c4cfca41ace8589c85b94e5a945 100644 (file)
@@ -6,7 +6,7 @@ ORM Internals
 Key ORM constructs, not otherwise covered in other
 sections, are listed here.
 
-.. currentmodule: sqlalchemy.orm
+.. currentmodule:: sqlalchemy.orm
 
 .. autoclass:: sqlalchemy.orm.state.AttributeState
     :members:
index 81679dd014da351aa0055ace8f0d46c7b9f7e9e7..387a3bf906dd90469bc66680977bfef63a79c55b 100644 (file)
@@ -189,7 +189,7 @@ at :ref:`relationship_aliased_class`.
 As far as the use case of a class that can actually be fully persisted
 to different tables under different scenarios, very early versions of
 SQLAlchemy offered a feature for this adapted from Hibernate, known
-as the "entity name" feature.  However, this use case became infeasable
+as the "entity name" feature.  However, this use case became infeasible
 within SQLAlchemy once the mapped class itself became the source of SQL
 expression construction; that is, the class' attributes themselves link
 directly to mapped table columns.   The feature was removed and replaced
index 5838a5c0c9e6beaae0b84a778e634a8de38e3c9e..8aa0da9c8a0143e6467d88f4438d4aa68853986e 100644 (file)
@@ -249,7 +249,7 @@ at :paramref:`_schema.Column.autoincrement`.
 
 For server-generating columns that are not primary key columns or that are not
 simple autoincrementing integer columns, the ORM requires that these columns
-are marked with an appropriate server_default directive that allows the ORM to
+are marked with an appropriate ``server_default`` directive that allows the ORM to
 retrieve this value.   Not all methods are supported on all backends, however,
 so care must be taken to use the appropriate method. The two questions to be
 answered are, 1. is this column part of the primary key or not, and 2. does the
index bf57ac6862a5709bd5a7b7209d13f1fb9b1f5bbc..df157c17c978cf9fd0dddcd38bb389dccfd6bee8 100644 (file)
@@ -522,10 +522,10 @@ Adding New or Existing Items
 ----------------------------
 
 :meth:`~.Session.add` is used to place instances in the
-session. For *transient* (i.e. brand new) instances, this will have the effect
+session. For :term:`transient` (i.e. brand new) instances, this will have the effect
 of an INSERT taking place for those instances upon the next flush. For
-instances which are *persistent* (i.e. were loaded by this session), they are
-already present and do not need to be added. Instances which are *detached*
+instances which are :term:`persistent` (i.e. were loaded by this session), they are
+already present and do not need to be added. Instances which are :term:`detached`
 (i.e. have been removed from a session) may be re-associated with a session
 using this method::
 
@@ -632,7 +632,7 @@ illustrated in the example below::
         # ...
 
         addresses = relationship(
-            "Address", cascade="all, delete, delete-orphan")
+            "Address", cascade="all, delete-orphan")
 
     # ...
 
@@ -654,7 +654,7 @@ that this related object is not to shared with any other parent simultaneously::
         # ...
 
         preference = relationship(
-            "Preference", cascade="all, delete, delete-orphan",
+            "Preference", cascade="all, delete-orphan",
             single_parent=True)
 
 
index 3e6f253acd37f9bb656cf3534c7d77285dcbbf5f..db66aa30e4561b4ad2acd5eb2f042b497311ccd4 100644 (file)
@@ -403,7 +403,7 @@ has multiple binds or some other custom scheme for :meth:`.Session.get_bind`,
 we can pass additional arguments to :meth:`.Session.connection` in order to
 affect how the bind is procured::
 
-    sess = my_sesssionmaker()
+    sess = my_sessionmaker()
 
     # set up a transaction for the bind associated with
     # the User mapper
index 477ed3012f299bb2cb33924bc1efa13a965020f8..dfd138671eb1ff834eb228f3634616e8cff6d413 100644 (file)
@@ -850,7 +850,7 @@ A number of methods on :class:`_query.Query`
 immediately issue SQL and return a value containing loaded
 database results.  Here's a brief tour:
 
-* :meth:`_query.Query.all()` returns a list:
+* :meth:`_query.Query.all` returns a list:
 
   .. sourcecode:: python+sql
 
@@ -881,7 +881,7 @@ database results.  Here's a brief tour:
             :ref:`faq_query_deduplicating`
 
 
-* :meth:`_query.Query.first()` applies a limit of one and returns
+* :meth:`_query.Query.first` applies a limit of one and returns
   the first result as a scalar:
 
   .. sourcecode:: python+sql
@@ -897,7 +897,7 @@ database results.  Here's a brief tour:
       ('%ed', 1, 0)
       {stop}<User(name='ed', fullname='Ed Jones', nickname='eddie')>
 
-* :meth:`_query.Query.one()` fully fetches all rows, and if not
+* :meth:`_query.Query.one` fully fetches all rows, and if not
   exactly one object identity or composite row is present in the result, raises
   an error.  With multiple rows found:
 
@@ -950,8 +950,8 @@ Literal strings can be used flexibly with
 :class:`~sqlalchemy.orm.query.Query`, by specifying their use
 with the :func:`_expression.text` construct, which is accepted
 by most applicable methods.  For example,
-:meth:`~sqlalchemy.orm.query.Query.filter()` and
-:meth:`~sqlalchemy.orm.query.Query.order_by()`:
+:meth:`_query.Query.filter` and
+:meth:`_query.Query.order_by`:
 
 .. sourcecode:: python+sql
 
@@ -973,7 +973,7 @@ by most applicable methods.  For example,
     fred
 
 Bind parameters can be specified with string-based SQL, using a colon. To
-specify the values, use the :meth:`~sqlalchemy.orm.query.Query.params()`
+specify the values, use the :meth:`_query.Query.params`
 method:
 
 .. sourcecode:: python+sql
@@ -991,7 +991,7 @@ method:
 
 To use an entirely string-based statement, a :func:`_expression.text` construct
 representing a complete statement can be passed to
-:meth:`~sqlalchemy.orm.query.Query.from_statement()`.  Without additional
+:meth:`_query.Query.from_statement`.  Without additional
 specifiers, the columns in the string SQL are matched to the model columns
 based on name, such as below where we use just an asterisk to represent
 loading all columns:
@@ -999,8 +999,7 @@ loading all columns:
 .. sourcecode:: python+sql
 
     {sql}>>> session.query(User).from_statement(
-    ...                     text("SELECT * FROM users where name=:name")).\
-    ...                     params(name='ed').all()
+    ...  text("SELECT * FROM users where name=:name")).params(name='ed').all()
     SELECT * FROM users where name=?
     ('ed',)
     {stop}[<User(name='ed', fullname='Ed Jones', nickname='eddie')>]
@@ -1056,7 +1055,7 @@ Counting
 --------
 
 :class:`~sqlalchemy.orm.query.Query` includes a convenience method for
-counting called :meth:`~sqlalchemy.orm.query.Query.count()`:
+counting called :meth:`_query.Query.count`:
 
 .. sourcecode:: python+sql
 
@@ -1081,7 +1080,7 @@ counting called :meth:`~sqlalchemy.orm.query.Query.count()`:
     and always returns the right answer.  Use ``func.count()`` if a
     particular statement absolutely cannot tolerate the subquery being present.
 
-The :meth:`_query.Query.count()` method is used to determine
+The :meth:`_query.Query.count` method is used to determine
 how many rows the SQL statement would return.   Looking
 at the generated SQL above, SQLAlchemy always places whatever it is we are
 querying into a subquery, then counts the rows from that.   In some cases
@@ -1344,7 +1343,7 @@ The `Wikipedia page on SQL JOIN
 join techniques, several of which we'll illustrate here.
 
 To construct a simple implicit join between ``User`` and ``Address``,
-we can use :meth:`_query.Query.filter()` to equate their related columns together.
+we can use :meth:`_query.Query.filter` to equate their related columns together.
 Below we load the ``User`` and ``Address`` entities at once using this method:
 
 .. sourcecode:: python+sql
index a10043db15578a629232af907f01f320fd0afd9b..187dbdc208c73e89311daf9fba8d1a5b03b1c377 100644 (file)
@@ -40,7 +40,7 @@ def _mssql_drop_ignore(conn, ident):
         # for row in conn.execute(
         #     "select session_id from sys.dm_exec_sessions "
         #        "where database_id=db_id('%s')" % ident):
-        #    log.info("killing SQL server sesssion %s", row['session_id'])
+        #    log.info("killing SQL server session %s", row['session_id'])
         #    conn.execute("kill %s" % row['session_id'])
 
         conn.execute("drop database %s" % ident)
index 1068052da5e162c3921aa34dbedc0d9d02f88573..ece6401f32787d89706be67d4611f88734a5ef93 100644 (file)
@@ -100,7 +100,7 @@ Unicode
 
 As is the case for all DBAPIs under Python 3, all strings are inherently
 Unicode strings.     Under Python 2, cx_Oracle also supports Python Unicode
-objects directly.    In all cases however, the driver requires an explcit
+objects directly.    In all cases however, the driver requires an explicit
 encoding configuration.
 
 Ensuring the Correct Client Encoding
index ea7b04d4f86d1cc964ff33811f25e943c9414600..255f1af21dd2f86d5a2ee69fa7a4bfa848b587f1 100644 (file)
@@ -234,8 +234,8 @@ class JSON(sqltypes.JSON):
 class JSONB(JSON):
     """Represent the PostgreSQL JSONB type.
 
-    The :class:`_postgresql.JSONB` type stores arbitrary JSONB format data, e.
-    g.::
+    The :class:`_postgresql.JSONB` type stores arbitrary JSONB format data,
+    e.g.::
 
         data_table = Table('data_table', metadata,
             Column('id', Integer, primary_key=True),
@@ -249,8 +249,8 @@ class JSONB(JSON):
             )
 
     The :class:`_postgresql.JSONB` type includes all operations provided by
-    :class:`_types.JSON`, including the same behaviors for indexing operations
-    .
+    :class:`_types.JSON`, including the same behaviors for indexing
+    operations.
     It also adds additional operators specific to JSONB, including
     :meth:`.JSONB.Comparator.has_key`, :meth:`.JSONB.Comparator.has_all`,
     :meth:`.JSONB.Comparator.has_any`, :meth:`.JSONB.Comparator.contains`,
index 4cf14b58d36e1bda606c390e7fe2788c0b4e692b..aad98c3982a2859df5b3b07f475d2271590f7951 100644 (file)
@@ -39,7 +39,7 @@ class Connection(Connectable):
     possible that the underlying DBAPI connection may not support shared
     access between threads.  Check the DBAPI documentation for details.
 
-    The Connection object represents a single dbapi connection checked out
+    The Connection object represents a single DBAPI connection checked out
     from the connection pool. In this state, the connection pool has no affect
     upon the connection, including its expiration or timeout state. For the
     connection pool to properly manage connections, connections should be
@@ -155,7 +155,7 @@ class Connection(Connectable):
 
     @property
     def _root(self):
-        """return the 'root' connection.
+        """Return the 'root' connection.
 
         Returns 'self' if this connection is not a branch, else
         returns the root connection from which we ultimately branched.
@@ -168,9 +168,8 @@ class Connection(Connectable):
             return self
 
     def _clone(self):
-        """Create a shallow copy of this Connection.
+        """Create a shallow copy of this Connection."""
 
-        """
         c = self.__class__.__new__(self.__class__)
         c.__dict__ = self.__dict__.copy()
         return c
@@ -1190,7 +1189,9 @@ class Connection(Connectable):
         self, dialect, constructor, statement, parameters, *args
     ):
         """Create an :class:`.ExecutionContext` and execute, returning
-        a :class:`_engine.ResultProxy`."""
+        a :class:`_engine.ResultProxy`.
+
+        """
 
         try:
             try:
@@ -2051,8 +2052,8 @@ class Engine(Connectable, log.Identified):
         return "Engine(%r)" % self.url
 
     def dispose(self):
-        """Dispose of the connection pool used by this :class:`_engine.Engine`
-        .
+        """Dispose of the connection pool used by this
+        :class:`_engine.Engine`.
 
         This has the effect of fully closing all **currently checked in**
         database connections.  Connections that are still checked out
index 06f7a86186df70620c17cd0d6e0bb821d64b31d0..258492471371e81bf9c9155ffc42a3a7f0687866 100644 (file)
@@ -289,8 +289,8 @@ class DefaultDialect(interfaces.Dialect):
         """True if this dialect supports sane rowcount even if RETURNING is
         in use.
 
-        For dialects that don't support RETURNING, this is synomous
-        with supports_sane_rowcount.
+        For dialects that don't support RETURNING, this is synonymous with
+        ``supports_sane_rowcount``.
 
         """
         return self.supports_sane_rowcount
index 31518ab871204fdaf125acb455ba64eb4558638b..b424ce90df3c0576b21bd7579f27606e887f8914 100644 (file)
@@ -241,28 +241,29 @@ class Dialect(object):
         `table_name`, and an optional string `schema`, return column
         information as a list of dictionaries with these keys:
 
-        name
+        * ``name`` -
           the column's name
 
-        type
+        * ``type`` -
           [sqlalchemy.types#TypeEngine]
 
-        nullable
+        * ``nullable`` -
           boolean
 
-        default
+        * ``default`` -
           the column's default value
 
-        autoincrement
+        * ``autoincrement`` -
           boolean
 
-        sequence
+        * ``sequence`` -
           a dictionary of the form
-              {'name' : str, 'start' :int, 'increment': int, 'minvalue': int,
-               'maxvalue': int, 'nominvalue': bool, 'nomaxvalue': bool,
-               'cycle': bool, 'cache': int, 'order': bool}
+          {'name' : str, 'start' :int, 'increment': int, 'minvalue': int,
+          'maxvalue': int, 'nominvalue': bool, 'nomaxvalue': bool,
+          'cycle': bool, 'cache': int, 'order': bool}
 
         Additional column attributes may be present.
+
         """
 
         raise NotImplementedError()
@@ -274,9 +275,7 @@ class Dialect(object):
         ":meth:`.Dialect.get_pk_constraint` method. ",
     )
     def get_primary_keys(self, connection, table_name, schema=None, **kw):
-        """Return information about primary keys in `table_name`.
-
-        """
+        """Return information about primary keys in `table_name`."""
 
         raise NotImplementedError()
 
@@ -288,10 +287,10 @@ class Dialect(object):
         `table_name`, and an optional string `schema`, return primary
         key information as a dictionary with these keys:
 
-        constrained_columns
+        * ``constrained_columns`` -
           a list of column names that make up the primary key
 
-        name
+        * ``name`` -
           optional name of the primary key constraint.
 
         """
@@ -304,19 +303,19 @@ class Dialect(object):
         `table_name`, and an optional string `schema`, return foreign
         key information as a list of dicts with these keys:
 
-        name
+        * ``name`` -
           the constraint's name
 
-        constrained_columns
+        * ``constrained_columns`` -
           a list of column names that make up the foreign key
 
-        referred_schema
+        * ``referred_schema`` -
           the name of the referred schema
 
-        referred_table
+        * ``referred_table`` -
           the name of the referred table
 
-        referred_columns
+        * ``referred_columns`` -
           a list of column names in the referred table that correspond to
           constrained_columns
         """
@@ -339,7 +338,7 @@ class Dialect(object):
     def get_view_names(self, connection, schema=None, **kw):
         """Return a list of all view names available in the database.
 
-        schema:
+        :param schema:
           Optional, retrieve names from a non-default schema.
         """
 
@@ -370,14 +369,15 @@ class Dialect(object):
         `table_name` and an optional string `schema`, return index
         information as a list of dictionaries with these keys:
 
-        name
+        * ``name`` -
           the index's name
 
-        column_names
+        * ``column_names`` -
           list of column names in order
 
-        unique
+        * ``unique`` -
           boolean
+
         """
 
         raise NotImplementedError()
@@ -390,13 +390,13 @@ class Dialect(object):
         Given a string `table_name` and an optional string `schema`, return
         unique constraint information as a list of dicts with these keys:
 
-        name
+        * ``name`` -
           the unique constraint's name
 
-        column_names
+        * ``column_names`` -
           list of column names in order
 
-        \**kw
+        * ``**kw`` -
           other options passed to the dialect's get_unique_constraints()
           method.
 
@@ -412,13 +412,13 @@ class Dialect(object):
         Given a string `table_name` and an optional string `schema`, return
         check constraint information as a list of dicts with these keys:
 
-        name
+        * ``name`` -
           the check constraint's name
 
-        sqltext
+        * ``sqltext`` -
           the check constraint's SQL expression
 
-        \**kw
+        * ``**kw`` -
           other options passed to the dialect's get_check_constraints()
           method.
 
@@ -450,7 +450,7 @@ class Dialect(object):
         """convert the given name to lowercase if it is detected as
         case insensitive.
 
-        this method is only used if the dialect defines
+        This method is only used if the dialect defines
         requires_name_normalize=True.
 
         """
@@ -460,7 +460,7 @@ class Dialect(object):
         """convert the given name to a case insensitive identifier
         for the backend if it is an all-lowercase name.
 
-        this method is only used if the dialect defines
+        This method is only used if the dialect defines
         requires_name_normalize=True.
 
         """
@@ -473,6 +473,7 @@ class Dialect(object):
         `table_name`, return True if the given table (possibly within
         the specified `schema`) exists in the database, False
         otherwise.
+
         """
 
         raise NotImplementedError()
@@ -483,6 +484,7 @@ class Dialect(object):
         Given a :class:`_engine.Connection` object and a string
         `sequence_name`, return True if the given sequence exists in
         the database, False otherwise.
+
         """
 
         raise NotImplementedError()
@@ -671,13 +673,17 @@ class Dialect(object):
 
     def do_executemany(self, cursor, statement, parameters, context=None):
         """Provide an implementation of ``cursor.executemany(statement,
-        parameters)``."""
+        parameters)``.
+
+        """
 
         raise NotImplementedError()
 
     def do_execute(self, cursor, statement, parameters, context=None):
         """Provide an implementation of ``cursor.execute(statement,
-        parameters)``."""
+        parameters)``.
+
+        """
 
         raise NotImplementedError()
 
@@ -694,7 +700,9 @@ class Dialect(object):
 
     def is_disconnect(self, e, connection, cursor):
         """Return True if the given DB-API error indicates an invalid
-        connection"""
+        connection.
+
+        """
 
         raise NotImplementedError()
 
@@ -732,7 +740,7 @@ class Dialect(object):
         """
 
     def on_connect(self):
-        """return a callable which sets up a newly created DBAPI connection.
+        """Return a callable which sets up a newly created DBAPI connection.
 
         The callable should accept a single argument "conn" which is the
         DBAPI connection itself.  The inner callable has no
@@ -882,7 +890,7 @@ class Dialect(object):
 
     @classmethod
     def load_provisioning(cls):
-        """set up the provision.py module for this dialect.
+        """Set up the provision.py module for this dialect.
 
         For dialects that include a provision.py module that sets up
         provisioning followers, this method should initiate that process.
@@ -1030,7 +1038,7 @@ class CreateEnginePlugin(object):
          what it needs here as well as remove its custom arguments from the
          :attr:`.URL.query` collection.  The URL can be modified in-place
          in any other way as well.
-        :param kwargs: The keyword arguments passed to :func`.create_engine`.
+        :param kwargs: The keyword arguments passed to :func:`.create_engine`.
          The plugin can read and modify this dictionary in-place, to affect
          the ultimate arguments used to create the engine.  It should
          remove its custom arguments from the dictionary as well.
@@ -1181,25 +1189,31 @@ class ExecutionContext(object):
         """Return a result object corresponding to this ExecutionContext.
 
         Returns a ResultProxy.
+
         """
 
         raise NotImplementedError()
 
     def handle_dbapi_exception(self, e):
         """Receive a DBAPI exception which occurred upon execute, result
-        fetch, etc."""
+        fetch, etc.
+
+        """
 
         raise NotImplementedError()
 
     def should_autocommit_text(self, statement):
         """Parse the given textual statement and return True if it refers to
-        a "committable" statement"""
+        a "committable" statement
+
+        """
 
         raise NotImplementedError()
 
     def lastrow_has_defaults(self):
         """Return True if the last INSERT or UPDATE row contained
         inlined or database-side defaults.
+
         """
 
         raise NotImplementedError()
index 55f75c6c42f940283368a3423f1a80c537f24ec7..93d5827d7c0ffdce54d63fa88d4db397a2c32b0a 100644 (file)
@@ -234,7 +234,7 @@ class Inspector(object):
             :meth:`_reflection.Inspector.get_table_names`
 
             :func:`.sort_tables_and_constraints` - similar method which works
-             with an already-given :class:`_schema.MetaData`.
+            with an already-given :class:`_schema.MetaData`.
 
         """
         if hasattr(self.dialect, "get_table_names"):
@@ -270,7 +270,7 @@ class Inspector(object):
         ] + [(None, list(remaining_fkcs))]
 
     def get_temp_table_names(self):
-        """return a list of temporary table names for the current bind.
+        """Return a list of temporary table names for the current bind.
 
         This method is unsupported by most dialects; currently
         only SQLite implements it.
@@ -283,7 +283,7 @@ class Inspector(object):
         )
 
     def get_temp_view_names(self):
-        """return a list of temporary view names for the current bind.
+        """Return a list of temporary view names for the current bind.
 
         This method is unsupported by most dialects; currently
         only SQLite implements it.
@@ -358,7 +358,7 @@ class Inspector(object):
         * ``autoincrement`` - indicates that the column is auto incremented -
           this is returned as a boolean or 'auto'
 
-        * ``comment`` - (optional) the commnet on the column. Only some
+        * ``comment`` - (optional) the comment on the column. Only some
           dialects return this key
 
         * ``computed`` - (optional) when present it indicates that this column
@@ -422,10 +422,10 @@ class Inspector(object):
         Given a string `table_name`, and an optional string `schema`, return
         primary key information as a dictionary with these keys:
 
-        constrained_columns
+        * ``constrained_columns`` -
           a list of column names that make up the primary key
 
-        name
+        * ``name`` -
           optional name of the primary key constraint.
 
         :param table_name: string name of the table.  For special quoting,
@@ -446,20 +446,20 @@ class Inspector(object):
         Given a string `table_name`, and an optional string `schema`, return
         foreign key information as a list of dicts with these keys:
 
-        constrained_columns
+        * ``constrained_columns`` -
           a list of column names that make up the foreign key
 
-        referred_schema
+        * ``referred_schema`` -
           the name of the referred schema
 
-        referred_table
+        * ``referred_table`` -
           the name of the referred table
 
-        referred_columns
+        * ``referred_columns`` -
           a list of column names in the referred table that correspond to
           constrained_columns
 
-        name
+        * ``name`` -
           optional name of the foreign key constraint.
 
         :param table_name: string name of the table.  For special quoting,
@@ -481,22 +481,22 @@ class Inspector(object):
         Given a string `table_name` and an optional string `schema`, return
         index information as a list of dicts with these keys:
 
-        name
+        * ``name`` -
           the index's name
 
-        column_names
+        * ``column_names`` -
           list of column names in order
 
-        unique
+        * ``unique`` -
           boolean
 
-        column_sorting
+        * ``column_sorting`` -
           optional dict mapping column names to tuple of sort keywords,
           which may include ``asc``, ``desc``, ``nullsfirst``, ``nullslast``.
 
           .. versionadded:: 1.3.5
 
-        dialect_options
+        * ``dialect_options`` -
           dict of dialect-specific index options.  May not be present
           for all dialects.
 
@@ -521,10 +521,10 @@ class Inspector(object):
         Given a string `table_name` and an optional string `schema`, return
         unique constraint information as a list of dicts with these keys:
 
-        name
+        * ``name`` -
           the unique constraint's name
 
-        column_names
+        * ``column_names`` -
           list of column names in order
 
         :param table_name: string name of the table.  For special quoting,
@@ -546,7 +546,7 @@ class Inspector(object):
         Given a string ``table_name`` and an optional string ``schema``,
         return table comment information as a dictionary with these keys:
 
-        text
+        * ``text`` -
             text of the comment.
 
         Raises ``NotImplementedError`` for a dialect that does not support
@@ -566,13 +566,13 @@ class Inspector(object):
         Given a string `table_name` and an optional string `schema`, return
         check constraint information as a list of dicts with these keys:
 
-        name
+        * ``name`` -
           the check constraint's name
 
-        sqltext
+        * ``sqltext`` -
           the check constraint's SQL expression
 
-        dialect_options
+        * ``dialect_options`` -
           may or may not be present; a dictionary with additional
           dialect-specific options for this CHECK constraint
 
@@ -601,8 +601,8 @@ class Inspector(object):
         resolve_fks=True,
         _extend_on=None,
     ):
-        """Given a Table object, load its internal constructs based on
-        introspection.
+        """Given a :class:`_schema.Table` object, load its internal
+        constructs based on introspection.
 
         This is the underlying method used by most dialects to produce
         table reflection.  Direct usage is like::
index 17abb372259629c7c35d29dafc5a4385589e09d5..ae25c6d93dfbebd1aacaddf8cd1e251ca34b91db 100644 (file)
@@ -871,7 +871,7 @@ class ResultProxy(object):
 
     @property
     def lastrowid(self):
-        """return the 'lastrowid' accessor on the DBAPI cursor.
+        """Return the 'lastrowid' accessor on the DBAPI cursor.
 
         This is a DBAPI specific method and is only functional
         for those backends which support it, for statements
index 7b7a0047ce18089bb17ef2dc868864c02c442474..f0685d9e33677d9737fbae62d83e252b18631fd4 100644 (file)
@@ -29,7 +29,7 @@ class URL(object):
 
     This object is suitable to be passed directly to a
     :func:`~sqlalchemy.create_engine` call.  The fields of the URL are parsed
-    from a string by the :func:`.make_url` function.  the string
+    from a string by the :func:`.make_url` function.  The string
     format of the URL is an RFC-1738-style string.
 
     All initialization parameters are available as public attributes.
index 9cff67033586bc03d5f993aed37662fd40261698..6bd63ceca6f9e74b571bce5ab85269fb64819c84 100644 (file)
@@ -67,7 +67,7 @@ def listen(target, identifier, fn, *args, **kw):
     .. warning:: The ``once`` argument does not imply automatic de-registration
        of the listener function after it has been invoked a first time; a
        listener entry will remain associated with the target object.
-       Associating an arbitrarily high number of listeners without explictitly
+       Associating an arbitrarily high number of listeners without explicitly
        removing them will cause memory to grow unbounded even if ``once=True``
        is specified.
 
@@ -134,7 +134,7 @@ def listens_for(target, identifier, *args, **kw):
     .. warning:: The ``once`` argument does not imply automatic de-registration
        of the listener function after it has been invoked a first time; a
        listener entry will remain associated with the target object.
-       Associating an arbitrarily high number of listeners without explictitly
+       Associating an arbitrarily high number of listeners without explicitly
        removing them will cause memory to grow unbounded even if ``once=True``
        is specified.
 
index 2eb8846f6137a65855cbae223f95492e1ab177f2..a87c1fe4484962d77911b5278307284f79cd49a9 100644 (file)
@@ -213,7 +213,7 @@ class Events(util.with_metaclass(_EventMeta, object)):
         # This allows an Events subclass to define additional utility
         # methods made available to the target via
         # "self.dispatch._events.<utilitymethod>"
-        # @staticemethod to allow easy "super" calls while in a metaclass
+        # @staticmethod to allow easy "super" calls while in a metaclass
         # constructor.
         cls.dispatch = dispatch_cls(None)
         dispatch_cls._events = cls
index 5918251f4803226476d6c663c007ffd0acf09e93..94c0f81eb59f8aff9e5cd9d5a72bb735bd153313 100644 (file)
@@ -844,8 +844,8 @@ class ObjectAssociationProxyInstance(AssociationProxyInstance):
         """Produce a proxied 'contains' expression using EXISTS.
 
         This expression will be a composed product
-        using the :meth:`.RelationshipProperty.Comparator.any`
-        :meth:`.RelationshipProperty.Comparator.has`,
+        using the :meth:`.RelationshipProperty.Comparator.any`,
+        :meth:`.RelationshipProperty.Comparator.has`,
         and/or :meth:`.RelationshipProperty.Comparator.contains`
         operators of the underlying proxied attributes.
         """
index 28a4b3c85822c80c9abf4e4903eb4c21951eec30..b59a03618158859b1eb749e13cfcd9352f50ad1c 100644 (file)
@@ -256,7 +256,8 @@ class declared_attr(interfaces._MappedAttribute, property):
                 def id(cls):
                     if has_inherited_table(cls):
                         return Column(
-                            ForeignKey('myclass.id'), primary_key=True)
+                            ForeignKey('myclass.id'), primary_key=True
+                        )
                     else:
                         return Column(Integer, primary_key=True)
 
index cd8ddc143b1aed29a7bb853c5946937801590cea..68f95a23fa1aa785eecf3598d57daf3d68c38306 100644 (file)
@@ -132,7 +132,7 @@ class _MultipleClassMarker(object):
 
 
 class _ModuleMarker(object):
-    """"refers to a module name within
+    """Refers to a module name within
     _decl_class_registry.
 
     """
index a9c0581df9fbef079a947a07dbcb63f1b83123ae..4ec4251edf5936240ea74ddc1a381bb5806c458f 100644 (file)
@@ -20,7 +20,6 @@ from .. import util
 from ..orm.query import Query
 from ..orm.session import Session
 
-
 __all__ = ["ShardedSession", "ShardedQuery"]
 
 
@@ -32,10 +31,11 @@ class ShardedQuery(Query):
         self._shard_id = None
 
     def set_shard(self, shard_id):
-        """return a new query, limited to a single shard ID.
+        """Return a new query, limited to a single shard ID.
 
-        all subsequent operations with the returned query will
+        All subsequent operations with the returned query will
         be against the single shard regardless of other state.
+
         """
 
         q = self._clone()
@@ -94,7 +94,7 @@ class ShardedQuery(Query):
         lazy_loaded_from=None,
         **kw
     ):
-        """override the default Query._identity_lookup method so that we
+        """Override the default Query._identity_lookup method so that we
         search for a given non-token primary key identity across all
         possible identity tokens (e.g. shard ids).
 
@@ -166,6 +166,7 @@ class ShardedResult(object):
     or ``rowcount``, which is the sum of all the individual rowcount values.
 
     .. versionadded::  1.3
+
     """
 
     __slots__ = ("result_proxies", "aggregate_rowcount")
index 9f73b5d31bc369dd0fcf460c653e61e9eaa63650..3361c95efe7964cb712b44a59dc214d883a86b78 100644 (file)
@@ -668,12 +668,11 @@ simple::
             return self.parent.parent
 
 For the expression, things are not so clear.   We'd need to construct a
-:class:`_query.Query` where we :meth:`_query.Query.join` twice along ``Node.
-parent`` to
-get to the ``grandparent``.   We can instead return a transforming callable
-that we'll combine with the :class:`.Comparator` class to receive any
-:class:`_query.Query` object, and return a new one that's joined to the
-``Node.parent`` attribute and filtered based on the given criterion::
+:class:`_query.Query` where we :meth:`_query.Query.join` twice along
+``Node.parent`` to get to the ``grandparent``.   We can instead return a
+transforming callable that we'll combine with the :class:`.Comparator` class to
+receive any :class:`_query.Query` object, and return a new one that's joined to
+the ``Node.parent`` attribute and filtered based on the given criterion::
 
     from sqlalchemy.ext.hybrid import Comparator
 
@@ -690,7 +689,7 @@ that we'll combine with the :class:`.Comparator` class to receive any
 
     class Node(Base):
         __tablename__ = 'node'
-        id =Column(Integer, primary_key=True)
+        id = Column(Integer, primary_key=True)
         parent_id = Column(Integer, ForeignKey('node.id'))
         parent = relationship("Node", remote_side=id)
 
@@ -711,7 +710,7 @@ the comparison ``Node(id=5)``.  A function ``transform`` is then returned which
 will transform a :class:`_query.Query` first to join to ``Node.parent``,
 then to
 compare ``parent_alias`` using :attr:`.Operators.eq` against the left and right
-sides, passing into :class:`_query.Query.filter`:
+sides, passing into :meth:`_query.Query.filter`:
 
 .. sourcecode:: pycon+sql
 
@@ -987,7 +986,7 @@ class hybrid_property(interfaces.InspectionAttrInfo):
 
         .. note::
 
-           when referring to a hybrid property  from an owning class (e.g.
+           When referring to a hybrid property  from an owning class (e.g.
            ``SomeClass.some_hybrid``), an instance of
            :class:`.QueryableAttribute` is returned, representing the
            expression or comparator object as well as this  hybrid object.
@@ -1027,7 +1026,7 @@ class hybrid_property(interfaces.InspectionAttrInfo):
 
         .. note::
 
-           when referring to a hybrid property  from an owning class (e.g.
+           When referring to a hybrid property  from an owning class (e.g.
            ``SomeClass.some_hybrid``), an instance of
            :class:`.QueryableAttribute` is returned, representing the
            expression or comparator object as this  hybrid object.  However,
index 378d7445f901d90e8332f2c8ef2791aafb310242..300d0d81cfa4199ce6c85a856a2c665cc55b5dea 100644 (file)
@@ -42,10 +42,10 @@ inheritance hierarchy.
 The value of this attribute must be a callable and will be passed a class
 object.  The callable must return one of:
 
-  - An instance of an InstrumentationManager or subclass
+  - An instance of an :class:`.InstrumentationManager` or subclass
   - An object implementing all or some of InstrumentationManager (TODO)
   - A dictionary of callables, implementing all or some of the above (TODO)
-  - An instance of a ClassManager or subclass
+  - An instance of a :class:`.ClassManager` or subclass
 
 This attribute is consulted by SQLAlchemy instrumentation
 resolution, once the :mod:`sqlalchemy.ext.instrumentation` module
index 7a957de54b0665a6b75ed1f3d5acd1e1b3152754..f492d9352a8d8c273fba434251cb31b36bb99d76 100644 (file)
@@ -477,8 +477,8 @@ class InspectionAttr(object):
     __slots__ = ()
 
     is_selectable = False
-    """Return True if this object is an instance of """
-    """:class:`expression.Selectable`."""
+    """Return True if this object is an instance of
+    :class:`_expression.Selectable`."""
 
     is_aliased_class = False
     """True if this object is an instance of :class:`.AliasedClass`."""
@@ -516,8 +516,8 @@ class InspectionAttr(object):
     """
 
     is_clause_element = False
-    """True if this object is an instance of """
-    """:class:`_expression.ClauseElement`."""
+    """True if this object is an instance of
+    :class:`_expression.ClauseElement`."""
 
     extension_type = NOT_EXTENSION
     """The extension type, if any.
index d037b8a04b515eaf9fc4f5e0e8654d150ebe4bb2..1200d871b8babcdeb6deeeb4397d0d28da7a6e18 100644 (file)
@@ -274,7 +274,7 @@ class AppenderMixin(object):
             # this is a hack right now.  The Query only knows how to
             # make subsequent joins() without a given left-hand side
             # from self._from_obj[0].  We need to ensure prop.secondary
-            # is in the FROM.  So we purposly put the mapper selectable
+            # is in the FROM.  So we purposely put the mapper selectable
             # in _from_obj[0] to ensure a user-defined join() later on
             # doesn't fail, and secondary is then in _from_obj[1].
             self._from_obj = (prop.mapper.selectable, prop.secondary)
index f73d0655aeb3505542c77ad93a17e4f9ef9544a2..d6a47576d75e05a599a9716d2293b6020999e1fe 100644 (file)
@@ -42,7 +42,7 @@ _memoized_key_collection = util.group_expirable_memoized_property()
 
 
 class ClassManager(dict):
-    """tracks state information at the class level."""
+    """Tracks state information at the class level."""
 
     MANAGER_ATTR = base.DEFAULT_MANAGER_ATTR
     STATE_ATTR = base.DEFAULT_STATE_ATTR
@@ -208,7 +208,7 @@ class ClassManager(dict):
         setattr(self.class_, self.MANAGER_ATTR, self)
 
     def dispose(self):
-        """Dissasociate this manager from its class."""
+        """Disassociate this manager from its class."""
 
         delattr(self.class_, self.MANAGER_ATTR)
 
@@ -472,7 +472,7 @@ class InstrumentationFactory(object):
 
 
 # this attribute is replaced by sqlalchemy.ext.instrumentation
-# when importred.
+# when imported.
 _instrumentation_factory = InstrumentationFactory()
 
 # these attributes are replaced by sqlalchemy.ext.instrumentation
index 6577dd40e5b3a2d535afe48a7fec5474741f1c48..a255cccc7b5eb89a1b66056f1ab98d7163a6818d 100644 (file)
@@ -28,7 +28,6 @@ from .. import exc as sa_exc
 from .. import util
 from ..sql import util as sql_util
 
-
 _new_runid = util.counter()
 
 
@@ -733,6 +732,7 @@ def _populate_full(
             for key, set_callable in populators["expire"]:
                 if set_callable:
                     state.expired_attributes.add(key)
+
         for key, populator in populators["new"]:
             populator(state, dict_, row)
         for key, populator in populators["delayed"]:
@@ -954,7 +954,7 @@ def load_scalar_attributes(mapper, state, attribute_names):
     # concrete inheritance, the class manager might have some keys
     # of attributes on the superclass that we didn't actually map.
     # These could be mapped as "concrete, dont load" or could be completely
-    # exluded from the mapping and we know nothing about them.  Filter them
+    # excluded from the mapping and we know nothing about them.  Filter them
     # here to prevent them from coming through.
     if attribute_names:
         attribute_names = attribute_names.intersection(mapper.attrs.keys())
index 84f3af5af958a8e86c45e4893b92ce276d8a8f75..1bcf0c9d410ecbee7a98cad27e0eb1331d238410 100644 (file)
@@ -336,7 +336,7 @@ class Mapper(InspectionAttr):
           that specify ``delete-orphan`` cascade.  This behavior is more
           consistent with that of a persistent object, and allows behavior to
           be consistent in more scenarios independently of whether or not an
-          orphanable object has been flushed yet or not.
+          orphan object has been flushed yet or not.
 
           See the change note and example at :ref:`legacy_is_orphan_addition`
           for more detail on this change.
@@ -754,7 +754,7 @@ class Mapper(InspectionAttr):
         return self.class_
 
     local_table = None
-    """The :class:`expression.Selectable` which this :class:`_orm.Mapper`
+    """The :class:`_expression.Selectable` which this :class:`_orm.Mapper`
     manages.
 
     Typically is an instance of :class:`_schema.Table` or
@@ -777,12 +777,11 @@ class Mapper(InspectionAttr):
     """
 
     persist_selectable = None
-    """The :class:`expression.Selectable` to which this :class:`_orm.Mapper`
+    """The :class:`_expression.Selectable` to which this :class:`_orm.Mapper`
     is mapped.
 
-    Typically an instance of :class:`_schema.Table`, :class:`_expression.Join`
-    , or
-    :class:`_expression.Alias`.
+    Typically an instance of :class:`_schema.Table`,
+    :class:`_expression.Join`, or :class:`_expression.Alias`.
 
     The :attr:`_orm.Mapper.persist_selectable` is separate from
     :attr:`_orm.Mapper.selectable` in that the former represents columns
index 9bc0869b17169d50eaa9dbd989e097e5fd69dfef..c62f6a90252684bb98c9cf2d19ae71a128a56a0e 100644 (file)
@@ -18,7 +18,6 @@ ORM session, whereas the ``Select`` construct interacts directly with the
 database to return iterable result sets.
 
 """
-
 from itertools import chain
 
 from . import attributes
@@ -54,7 +53,6 @@ from ..sql.base import ColumnCollection
 from ..sql.expression import _interpret_as_from
 from ..sql.selectable import ForUpdateArg
 
-
 __all__ = ["Query", "QueryContext", "aliased"]
 
 
@@ -131,8 +129,7 @@ class Query(object):
 
     lazy_loaded_from = None
     """An :class:`.InstanceState` that is using this :class:`_query.Query`
-    for a
-    lazy load operation.
+    for a lazy load operation.
 
     The primary rationale for this attribute is to support the horizontal
     sharding extension, where it is available within specific query
@@ -194,6 +191,7 @@ class Query(object):
             :meth:`_query.Query.with_session`
 
         """
+
         self.session = session
         self._polymorphic_adapters = {}
         self._set_entities(entities)
@@ -400,7 +398,7 @@ class Query(object):
         return self._entities[0]
 
     def _mapper_zero(self):
-        """return the Mapper associated with the first QueryEntity."""
+        """Return the Mapper associated with the first QueryEntity."""
         return self._entities[0].mapper
 
     def _entity_zero(self):
@@ -565,7 +563,7 @@ class Query(object):
         return stmt
 
     def subquery(self, name=None, with_labels=False, reduce_columns=False):
-        """return the full SELECT statement represented by
+        """Return the full SELECT statement represented by
         this :class:`_query.Query`, embedded within an
         :class:`_expression.Alias`.
 
@@ -660,7 +658,7 @@ class Query(object):
         :class:`_query.Query`, converted
         to a scalar subquery with a label of the given name.
 
-        Analogous to :meth:`sqlalchemy.sql.expression.SelectBase.label`.
+        Analogous to :meth:`_expression.SelectBase.label`.
 
         """
 
@@ -670,7 +668,7 @@ class Query(object):
         """Return the full SELECT statement represented by this
         :class:`_query.Query`, converted to a scalar subquery.
 
-        Analogous to :meth:`sqlalchemy.sql.expression.SelectBase.as_scalar`.
+        Analogous to :meth:`_expression.SelectBase.as_scalar`.
 
         """
 
@@ -770,9 +768,8 @@ class Query(object):
 
         .. note:: The :meth:`_query.Query.with_labels` method *only* applies
            the output of :attr:`_query.Query.statement`, and *not* to any of
-           the result-row invoking systems of :class:`_query.Query` itself, e.
-           g.
-           :meth:`_query.Query.first`, :meth:`_query.Query.all`, etc.
+           the result-row invoking systems of :class:`_query.Query` itself,
+           e.g. :meth:`_query.Query.first`, :meth:`_query.Query.all`, etc.
            To execute
            a query using :meth:`_query.Query.with_labels`, invoke the
            :attr:`_query.Query.statement` using :meth:`.Session.execute`::
@@ -818,7 +815,7 @@ class Query(object):
 
     @_generative()
     def _with_current_path(self, path):
-        """indicate that this query applies to objects loaded
+        """Indicate that this query applies to objects loaded
         within a certain path.
 
         Used by deferred loaders (see strategies.py) which transfer
@@ -994,8 +991,8 @@ class Query(object):
          the order in which they correspond to the mapped
          :class:`_schema.Table`
          object's primary key columns, or if the
-         :paramref:`_orm.Mapper.primary_key` configuration parameter were used
-         , in
+         :paramref:`_orm.Mapper.primary_key` configuration parameter were
+         used, in
          the order used for that parameter. For example, if the primary key
          of a row is represented by the integer
          digits "5, 10" the call would look like::
@@ -1139,10 +1136,9 @@ class Query(object):
 
     @_generative()
     def correlate(self, *args):
-        """Return a :class:`_query.Query`
-        construct which will correlate the given
-        FROM clauses to that of an enclosing :class:`_query.Query` or
-        :func:`_expression.select`.
+        """Return a :class:`.Query` construct which will correlate the given
+        FROM clauses to that of an enclosing :class:`.Query` or
+        :func:`~.expression.select`.
 
         The method here accepts mapped classes, :func:`.aliased` constructs,
         and :func:`.mapper` constructs as arguments, which are resolved into
@@ -1473,6 +1469,7 @@ class Query(object):
          those being selected.
 
         """
+
         fromclause = (
             self.with_labels()
             .enable_eagerloads(False)
@@ -1519,7 +1516,9 @@ class Query(object):
 
     def values(self, *columns):
         """Return an iterator yielding result tuples corresponding
-        to the given list of columns"""
+        to the given list of columns.
+
+        """
 
         if not columns:
             return iter(())
@@ -1533,7 +1532,9 @@ class Query(object):
 
     def value(self, column):
         """Return a scalar result corresponding to the given
-        column expression."""
+        column expression.
+
+        """
         try:
             return next(self.values(column))[0]
         except StopIteration:
@@ -1609,6 +1610,7 @@ class Query(object):
             :ref:`relationship_loader_options`
 
         """
+
         return self._options(False, *args)
 
     def _conditional_options(self, *args):
@@ -1656,7 +1658,7 @@ class Query(object):
         this :class:`_query.Query`.
 
         Functionality is passed straight through to
-        :meth:`~sqlalchemy.sql.expression.Select.with_hint`,
+        :meth:`_expression.Select.with_hint`,
         with the addition that ``selectable`` can be a
         :class:`_schema.Table`, :class:`_expression.Alias`,
         or ORM entity / mapped class
@@ -1671,13 +1673,14 @@ class Query(object):
             optimizer hints
 
         """
+
         if selectable is not None:
             selectable = inspect(selectable).selectable
 
         self._with_hints += ((selectable, text, dialect_name),)
 
     def with_statement_hint(self, text, dialect_name="*"):
-        """add a statement hint to this :class:`_expression.Select`.
+        """Add a statement hint to this :class:`_expression.Select`.
 
         This method is similar to :meth:`_expression.Select.with_hint`
         except that
@@ -1810,10 +1813,10 @@ class Query(object):
 
     @_generative()
     def params(self, *args, **kwargs):
-        r"""add values for bind parameters which may have been
+        r"""Add values for bind parameters which may have been
         specified in filter().
 
-        parameters may be specified using \**kwargs, or optionally a single
+        Parameters may be specified using \**kwargs, or optionally a single
         dictionary as the first positional argument. The reason for both is
         that \**kwargs is convenient, however some parameter dictionaries
         contain unicode keys in which case \**kwargs cannot be used.
@@ -1831,7 +1834,7 @@ class Query(object):
 
     @_generative(_no_statement_condition, _no_limit_offset)
     def filter(self, *criterion):
-        r"""apply the given filtering criterion to a copy
+        r"""Apply the given filtering criterion to a copy
         of this :class:`_query.Query`, using SQL expressions.
 
         e.g.::
@@ -1866,7 +1869,7 @@ class Query(object):
                 self._criterion = criterion
 
     def filter_by(self, **kwargs):
-        r"""apply the given filtering criterion to a copy
+        r"""Apply the given filtering criterion to a copy
         of this :class:`_query.Query`, using keyword expressions.
 
         e.g.::
@@ -1907,8 +1910,8 @@ class Query(object):
 
     @_generative(_no_statement_condition, _no_limit_offset)
     def order_by(self, *criterion):
-        """apply one or more ORDER BY criterion to the query and return
-        the newly resulting ``Query``
+        """Apply one or more ORDER BY criterion to the query and return
+        the newly resulting :class:`_query.Query`.
 
         All existing ORDER BY settings can be suppressed by
         passing ``None`` - this will suppress any ordering configured
@@ -1935,15 +1938,15 @@ class Query(object):
 
     @_generative(_no_statement_condition, _no_limit_offset)
     def group_by(self, *criterion):
-        """apply one or more GROUP BY criterion to the query and return
-        the newly resulting :class:`_query.Query`
+        """Apply one or more GROUP BY criterion to the query and return
+        the newly resulting :class:`_query.Query`.
 
         All existing GROUP BY settings can be suppressed by
         passing ``None`` - this will suppress any GROUP BY configured
         on mappers as well.
 
-        .. versionadded:: 1.1 GROUP BY can be cancelled by passing None,
-           in the same way as ORDER BY.
+        .. versionadded:: 1.1 GROUP BY can be cancelled by passing
+           ``None``, in the same way as ORDER BY.
 
         """
 
@@ -1962,7 +1965,7 @@ class Query(object):
 
     @_generative(_no_statement_condition, _no_limit_offset)
     def having(self, criterion):
-        r"""apply a HAVING criterion to the query and return the
+        r"""Apply a HAVING criterion to the query and return the
         newly resulting :class:`_query.Query`.
 
         :meth:`_query.Query.having` is used in conjunction with
@@ -2105,7 +2108,7 @@ class Query(object):
         Where above, the call to :meth:`_query.Query.join` along
         ``User.addresses`` will result in SQL approximately equivalent to::
 
-            SELECT user.id, User.name
+            SELECT user.id, user.name
             FROM user JOIN address ON user.id = address.user_id
 
         In the above example we refer to ``User.addresses`` as passed to
@@ -2378,10 +2381,11 @@ class Query(object):
         )
 
     def outerjoin(self, *props, **kwargs):
-        """Create a left outer join against this ``Query`` object's criterion
-        and apply generatively, returning the newly resulting ``Query``.
+        """Create a left outer join against this :class:`_query.Query`
+        object's criterion and apply generatively, returning the newly
+        resulting :class:`_query.Query`.
 
-        Usage is the same as the ``join()`` method.
+        Usage is the same as the :meth:`_query.Query.join` method.
 
         """
         aliased, from_joinpoint, full = (
@@ -2415,7 +2419,8 @@ class Query(object):
 
     @_generative(_no_statement_condition, _no_limit_offset)
     def _join(self, keys, outerjoin, full, create_aliases, from_joinpoint):
-        """consumes arguments from join() or outerjoin(), places them into a
+        """Consumes arguments from :meth:`_query.Query.join` or
+        :meth:`_query.Query.outerjoin`, places them into a
         consistent format with which to form the actual JOIN constructs.
 
         """
@@ -2559,7 +2564,7 @@ class Query(object):
     def _join_left_to_right(
         self, left, right, onclause, prop, create_aliases, outerjoin, full
     ):
-        """given raw "left", "right", "onclause" parameters consumed from
+        """Given raw "left", "right", "onclause" parameters consumed from
         a particular key within _join(), add a real ORMJoin object to
         our _from_obj list (or augment an existing one)
 
@@ -2806,7 +2811,7 @@ class Query(object):
     def _join_check_and_adapt_right_side(
         self, left, right, onclause, prop, create_aliases
     ):
-        """transform the "right" side of the join as well as the onclause
+        """Transform the "right" side of the join as well as the onclause
         according to polymorphic mapping translations, aliasing on the query
         or on the join, special cases where the right and left side have
         overlapping tables.
@@ -3224,7 +3229,7 @@ class Query(object):
     @_generative(_no_statement_condition)
     def limit(self, limit):
         """Apply a ``LIMIT`` to the query and return the newly resulting
-        ``Query``.
+        :class:`_query.Query`.
 
         """
         self._limit = limit
@@ -3232,7 +3237,7 @@ class Query(object):
     @_generative(_no_statement_condition)
     def offset(self, offset):
         """Apply an ``OFFSET`` to the query and return the newly resulting
-        ``Query``.
+        :class:`_query.Query`.
 
         """
         self._offset = offset
@@ -3240,7 +3245,7 @@ class Query(object):
     @_generative(_no_statement_condition)
     def distinct(self, *expr):
         r"""Apply a ``DISTINCT`` to the query and return the newly resulting
-        ``Query``.
+        :class:`_query.Query`.
 
 
         .. note::
@@ -3272,7 +3277,7 @@ class Query(object):
     @_generative()
     def prefix_with(self, *prefixes):
         r"""Apply the prefixes to the query and return the newly resulting
-        ``Query``.
+        :class:`_query.Query`.
 
         :param \*prefixes: optional prefixes, typically strings,
          not using any commas.   In particular is useful for MySQL keywords
@@ -3303,7 +3308,7 @@ class Query(object):
     @_generative()
     def suffix_with(self, *suffixes):
         r"""Apply the suffix to the query and return the newly resulting
-        ``Query``.
+        :class:`_query.Query`.
 
         :param \*suffixes: optional suffixes, typically strings,
          not using any commas.
@@ -4248,7 +4253,7 @@ class LockmodeArg(ForUpdateArg):
 
 
 class _QueryEntity(object):
-    """represent an entity column returned within a Query result."""
+    """Represent an entity column returned within a Query result."""
 
     def __new__(cls, *args, **kwargs):
         if cls is _QueryEntity:
@@ -4301,10 +4306,11 @@ class _MapperEntity(_QueryEntity):
     def set_with_polymorphic(
         self, query, cls_or_mappers, selectable, polymorphic_on
     ):
-        """Receive an update from a call to query.with_polymorphic().
+        """Receive an update from a call to
+        :meth:`_query.Query.with_polymorphic`.
 
-        Note the newer style of using a free standing with_polymporphic()
-        construct doesn't make use of this method.
+        Note the newer style of using a free standing
+        ``with_polymporphic()`` construct doesn't make use of this method.
 
 
         """
@@ -4433,8 +4439,7 @@ class _MapperEntity(_QueryEntity):
 @inspection._self_inspects
 class Bundle(InspectionAttr):
     """A grouping of SQL expressions that are returned by a
-    :class:`_query.Query`
-    under one namespace.
+    :class:`_query.Query` under one namespace.
 
     The :class:`.Bundle` essentially allows nesting of the tuple-based
     results returned by a column-oriented :class:`_query.Query` object.
@@ -4912,8 +4917,7 @@ class QueryContext(object):
 class AliasOption(interfaces.MapperOption):
     def __init__(self, alias):
         r"""Return a :class:`.MapperOption` that will indicate to the
-        :class:`_query.Query`
-        that the main table has been aliased.
+        :class:`_query.Query` that the main table has been aliased.
 
         This is a seldom-used option to suit the
         very rare case that :func:`.contains_eager`
index 530ccdd9cfeb3709841c3633dd668e5220ac5d9e..1402d7c103a26421e70366421c3a322023efb4ff 100644 (file)
@@ -39,13 +39,13 @@ from ..sql import util as sql_util
 __all__ = ["Session", "SessionTransaction", "SessionExtension", "sessionmaker"]
 
 _sessions = weakref.WeakValueDictionary()
-"""Weak-referencing dictionary of :class:`.Session` objects.
-"""
+"""Weak-referencing dictionary of :class:`.Session` objects."""
 
 
 def _state_session(state):
     """Given an :class:`.InstanceState`, return the :class:`.Session`
-        associated, if any.
+    associated, if any.
+
     """
     if state.session_id:
         try:
@@ -123,8 +123,8 @@ class SessionTransaction(object):
 
     **Life Cycle**
 
-    A :class:`.SessionTransaction` is associated with a :class:`.Session`
-    in its default mode of ``autocommit=False`` immediately, associated
+    A :class:`.SessionTransaction` is associated with a :class:`.Session` in
+    its default mode of ``autocommit=False`` immediately, associated
     with no database connections.  As the :class:`.Session` is called upon
     to emit SQL on behalf of various :class:`_engine.Engine` or
     :class:`_engine.Connection`
@@ -1127,7 +1127,7 @@ class Session(_SessionClassMethods):
             :ref:`session_transaction_isolation`
 
         :param \**kw:
-          Additional keyword arguments are sent to :meth:`get_bind()`,
+          Additional keyword arguments are sent to :meth:`get_bind`,
           allowing additional arguments to be passed to custom
           implementations of :meth:`get_bind`.
 
@@ -1393,8 +1393,8 @@ class Session(_SessionClassMethods):
 
     def bind_mapper(self, mapper, bind):
         """Associate a :class:`_orm.Mapper` or arbitrary Python class with a
-        "bind", e.g. an :class:`_engine.Engine` or :class:`_engine.Connection`
-        .
+        "bind", e.g. an :class:`_engine.Engine` or
+        :class:`_engine.Connection`.
 
         The given entity is added to a lookup used by the
         :meth:`.Session.get_bind` method.
@@ -1466,15 +1466,15 @@ class Session(_SessionClassMethods):
 
         The order of resolution is:
 
-        1. if mapper given and session.binds is present,
+        1. if mapper given and :paramref:`.Session.binds` is present,
            locate a bind based first on the mapper in use, then
            on the mapped class in use, then on any base classes that are
            present in the ``__mro__`` of the mapped class, from more specific
            superclasses to more general.
-        2. if clause given and session.binds is present,
+        2. if clause given and ``Session.binds`` is present,
            locate a bind based on :class:`_schema.Table` objects
-           found in the given clause present in session.binds.
-        3. if session.bind is present, return that.
+           found in the given clause present in ``Session.binds``.
+        3. if ``Session.binds`` is present, return that.
         4. if clause given, attempt to return a bind
            linked to the :class:`_schema.MetaData` ultimately
            associated with the clause.
@@ -2418,7 +2418,7 @@ class Session(_SessionClassMethods):
 
         .. seealso::
 
-            ``load_on_pending`` at :func:`_orm.relationship` - this flag
+            :paramref:`_orm.relationship.load_on_pending` - this flag
             allows per-relationship loading of many-to-ones on items that
             are pending.
 
@@ -3209,7 +3209,7 @@ class sessionmaker(_SessionClassMethods):
 
         sess = Session()
 
-    .. seealso:
+    .. seealso::
 
         :ref:`session_getting` - introductory text on creating
         sessions using :class:`.sessionmaker`.
index f42f1653ca10be8dde10c40094d5202416c4b4cf..e1aa4ddc294d53d63e77a88cbcf572fc4b263a22 100644 (file)
@@ -119,7 +119,7 @@ class InstanceState(interfaces.InspectionAttrInfo):
 
     @property
     def transient(self):
-        """Return true if the object is :term:`transient`.
+        """Return ``True`` if the object is :term:`transient`.
 
         .. seealso::
 
@@ -130,7 +130,7 @@ class InstanceState(interfaces.InspectionAttrInfo):
 
     @property
     def pending(self):
-        """Return true if the object is :term:`pending`.
+        """Return ``True`` if the object is :term:`pending`.
 
 
         .. seealso::
@@ -142,7 +142,7 @@ class InstanceState(interfaces.InspectionAttrInfo):
 
     @property
     def deleted(self):
-        """Return true if the object is :term:`deleted`.
+        """Return ``True`` if the object is :term:`deleted`.
 
         An object that is in the deleted state is guaranteed to
         not be within the :attr:`.Session.identity_map` of its parent
@@ -196,7 +196,7 @@ class InstanceState(interfaces.InspectionAttrInfo):
 
     @property
     def persistent(self):
-        """Return true if the object is :term:`persistent`.
+        """Return ``True`` if the object is :term:`persistent`.
 
         An object that is in the persistent state is guaranteed to
         be within the :attr:`.Session.identity_map` of its parent
@@ -217,7 +217,7 @@ class InstanceState(interfaces.InspectionAttrInfo):
 
     @property
     def detached(self):
-        """Return true if the object is :term:`detached`.
+        """Return ``True`` if the object is :term:`detached`.
 
         .. seealso::
 
@@ -320,7 +320,7 @@ class InstanceState(interfaces.InspectionAttrInfo):
         """Return ``True`` if this object has an identity key.
 
         This should always have the same value as the
-        expression ``state.persistent or state.detached``.
+        expression ``state.persistent`` or ``state.detached``.
 
         """
         return bool(self.key)
index 24e6fe205eb68983fe854f4089846d3611621996..6e0bea550e6c0bf6f219ac01b292ad9bfe8cc75e 100644 (file)
@@ -178,7 +178,7 @@ class UOWTransaction(object):
         return bool(self.states)
 
     def was_already_deleted(self, state):
-        """return true if the given state is expired and was deleted
+        """Return ``True`` if the given state is expired and was deleted
         previously.
         """
         if state.expired:
@@ -190,7 +190,7 @@ class UOWTransaction(object):
         return False
 
     def is_deleted(self, state):
-        """return true if the given state is marked as deleted
+        """Return ``True`` if the given state is marked as deleted
         within this uowtransaction."""
 
         return state in self.states and self.states[state][0]
@@ -203,7 +203,7 @@ class UOWTransaction(object):
             return ret
 
     def remove_state_actions(self, state):
-        """remove pending actions for a state from the uowtransaction."""
+        """Remove pending actions for a state from the uowtransaction."""
 
         isdelete = self.states[state][0]
 
@@ -212,7 +212,7 @@ class UOWTransaction(object):
     def get_attribute_history(
         self, state, key, passive=attributes.PASSIVE_NO_INITIALIZE
     ):
-        """facade to attributes.get_state_history(), including
+        """Facade to attributes.get_state_history(), including
         caching of results."""
 
         hashkey = ("history", state, key)
@@ -422,10 +422,10 @@ class UOWTransaction(object):
                 rec.execute(self)
 
     def finalize_flush_changes(self):
-        """mark processed objects as clean / deleted after a successful
+        """Mark processed objects as clean / deleted after a successful
         flush().
 
-        this method is called within the flush() method after the
+        This method is called within the flush() method after the
         execute() method has succeeded and the transaction has been committed.
 
         """
index c49c132c9145db60f9673cfc398d1b7f0d3c79cc..46165674d7ae19f576532c3c49000f33530a3da9 100644 (file)
@@ -50,7 +50,8 @@ all_cascades = frozenset(
 
 
 class CascadeOptions(frozenset):
-    """Keeps track of the options sent to relationship().cascade"""
+    """Keeps track of the options sent to
+    :paramref:`.relationship.cascade`"""
 
     _add_w_all_cascades = all_cascades.difference(
         ["all", "none", "delete-orphan"]
@@ -254,7 +255,7 @@ def polymorphic_union(
 
 
 def identity_key(*args, **kwargs):
-    """Generate "identity key" tuples, as are used as keys in the
+    r"""Generate "identity key" tuples, as are used as keys in the
     :attr:`.Session.identity_map` dictionary.
 
     This function has several call styles:
@@ -757,31 +758,32 @@ def aliased(element, alias=None, name=None, flat=False, adapt_on_names=False):
 
         session.query(MyClass, my_alias).filter(MyClass.id > my_alias.id)
 
-    The :func:`.aliased` function is used to create an ad-hoc mapping
-    of a mapped class to a new selectable.  By default, a selectable
-    is generated from the normally mapped selectable (typically a
-    :class:`_schema.Table`) using the :meth:`_expression.FromClause.alias`
-    method.
-    However, :func:`.aliased` can also be used to link the class to
-    a new :func:`_expression.select` statement.   Also, the
-    :func:`.with_polymorphic`
-    function is a variant of :func:`.aliased` that is intended to specify
-    a so-called "polymorphic selectable", that corresponds to the union
-    of several joined-inheritance subclasses at once.
+    The :func:`.aliased` function is used to create an ad-hoc mapping of a
+    mapped class to a new selectable.  By default, a selectable is generated
+    from the normally mapped selectable (typically a :class:`_schema.Table`)
+    using the
+    :meth:`_expression.FromClause.alias` method. However, :func:`.aliased`
+    can also be
+    used to link the class to a new :func:`_expression.select` statement.
+    Also, the :func:`.with_polymorphic` function is a variant of
+    :func:`.aliased` that is intended to specify a so-called "polymorphic
+    selectable", that corresponds to the union of several joined-inheritance
+    subclasses at once.
 
     For convenience, the :func:`.aliased` function also accepts plain
     :class:`_expression.FromClause` constructs, such as a
     :class:`_schema.Table` or
     :func:`_expression.select` construct.   In those cases, the
     :meth:`_expression.FromClause.alias`
-    method is called on the object and the new :class:`_expression.Alias`
-    object
-    returned.  The returned :class:`_expression.Alias`
-    is not ORM-mapped in this case.
+    method is called on the object and the new
+    :class:`_expression.Alias` object returned.  The returned
+    :class:`_expression.Alias` is not
+    ORM-mapped in this case.
 
     :param element: element to be aliased.  Is normally a mapped class,
-     but for convenience can also be a :class:`_expression.FromClause` element
-     .
+     but for convenience can also be a :class:`_expression.FromClause`
+     element.
+
     :param alias: Optional selectable unit to map the element to.  This is
      usually used to link the object to a subquery, and should be an aliased
      select construct as one would produce from the
index e95a35b19a0b6e53f1cbf33de50268384548908f..0c350d3f48c4e45bf2b7ba1fa8572cac5391a84d 100644 (file)
@@ -331,7 +331,7 @@ class Generative(object):
 
 
 class Executable(Generative):
-    """Mark a ClauseElement as supporting execution.
+    """Mark a :class:`_expression.ClauseElement` as supporting execution.
 
     :class:`.Executable` is a superclass for all "statement" types
     of objects, including :func:`select`, :func:`delete`, :func:`update`,
@@ -345,7 +345,7 @@ class Executable(Generative):
 
     @_generative
     def execution_options(self, **kw):
-        """ Set non-SQL options for the statement which take effect during
+        """Set non-SQL options for the statement which take effect during
         execution.
 
         Execution options can be set on a per-statement or
@@ -391,13 +391,14 @@ class Executable(Generative):
         self._execution_options = self._execution_options.union(kw)
 
     def get_execution_options(self):
-        """ Get the non-SQL options which will take effect during execution.
+        """Get the non-SQL options which will take effect during execution.
 
         .. versionadded:: 1.3
 
         .. seealso::
 
             :meth:`.Executable.execution_options`
+
         """
         return self._execution_options
 
@@ -426,8 +427,7 @@ class Executable(Generative):
     @property
     def bind(self):
         """Returns the :class:`_engine.Engine` or :class:`_engine.Connection`
-        to
-        which this :class:`.Executable` is bound, or None if none found.
+        to which this :class:`.Executable` is bound, or None if none found.
 
         This is a traversal which checks locally, then
         checks among the "from" clauses of associated objects
@@ -491,17 +491,17 @@ class ColumnCollection(util.OrderedProperties):
         return repr([str(c) for c in self])
 
     def replace(self, column):
-        """add the given column to this collection, removing unaliased
+        """Add the given column to this collection, removing unaliased
            versions of this column  as well as existing columns with the
            same key.
 
-            e.g.::
+           E.g.::
 
                 t = Table('sometable', metadata, Column('col1', Integer))
                 t.columns.replace(Column('col1', Integer, key='columnone'))
 
-            will remove the original 'col1' from the collection, and add
-            the new column under the name 'columnname'.
+           will remove the original 'col1' from the collection, and add
+           the new column under the name 'columnname'.
 
            Used by schema.Column to override columns during table reflection.
 
index 1f337e7abc7b95cc95e43637a95a97f31dd46737..d7753223117f53f2c03b42c18e9100c3e9932bc1 100644 (file)
@@ -86,10 +86,10 @@ class DDLElement(Executable, _DDLCompiles):
           ``.bind`` property.
 
         :param target:
-          Optional, defaults to None.  The target SchemaItem for the
-          execute call.  Will be passed to the ``on`` callable if any,
-          and may also provide string expansion data for the
-          statement. See ``execute_at`` for more information.
+          Optional, defaults to None.  The target :class:`_schema.SchemaItem`
+          for the execute call.  Will be passed to the ``on`` callable if any,
+          and may also provide string expansion data for the statement.
+          See ``execute_at`` for more information.
 
         """
 
@@ -203,7 +203,7 @@ class DDLElement(Executable, _DDLCompiles):
              set during the call to ``create()``, ``create_all()``,
              ``drop()``, ``drop_all()``.
 
-          If the callable returns a true value, the DDL statement will be
+          If the callable returns a True value, the DDL statement will be
           executed.
 
         :param state: any value which will be passed to the callable\_
@@ -1040,8 +1040,8 @@ class SchemaDropper(DDLBase):
 def sort_tables(
     tables, skip_fn=None, extra_dependencies=None,
 ):
-    """sort a collection of :class:`_schema.Table` objects based on dependency
-    .
+    """Sort a collection of :class:`_schema.Table` objects based on
+    dependency.
 
     This is a dependency-ordered sort which will emit :class:`_schema.Table`
     objects such that they will follow their dependent :class:`_schema.Table`
@@ -1125,7 +1125,7 @@ def sort_tables(
 def sort_tables_and_constraints(
     tables, filter_fn=None, extra_dependencies=None, _warn_for_cycles=False
 ):
-    """sort a collection of :class:`_schema.Table`  /
+    """Sort a collection of :class:`_schema.Table`  /
     :class:`_schema.ForeignKeyConstraint`
     objects.
 
index c3a9c8f9b65e46aee2190a6edb91206671588c4a..c653dcef3ca6a2cc4eb1e70a13b94f585f527fe2 100644 (file)
@@ -193,7 +193,8 @@ class UpdateBase(
         :param dialect_name: defaults to ``*``, if specified as the name
          of a particular dialect, will apply these hints only when
          that dialect is in use.
-         """
+
+        """
         if selectable is None:
             selectable = self.table
 
@@ -222,7 +223,7 @@ class ValuesBase(UpdateBase):
 
     @_generative
     def values(self, *args, **kwargs):
-        r"""specify a fixed VALUES clause for an INSERT statement, or the SET
+        r"""Specify a fixed VALUES clause for an INSERT statement, or the SET
         clause for an UPDATE.
 
         Note that the :class:`_expression.Insert` and
@@ -254,31 +255,28 @@ class ValuesBase(UpdateBase):
          as a single positional argument in order to form the VALUES or
          SET clause of the statement.  The forms that are accepted vary
          based on whether this is an :class:`_expression.Insert` or an
-         :class:`_expression.Update`
-         construct.
+         :class:`_expression.Update` construct.
 
          For either an :class:`_expression.Insert` or
-         :class:`_expression.Update` construct, a
-         single dictionary can be passed, which works the same as that of
-         the kwargs form::
+         :class:`_expression.Update`
+         construct, a single dictionary can be passed, which works the same as
+         that of the kwargs form::
 
             users.insert().values({"name": "some name"})
 
             users.update().values({"name": "some new name"})
 
          Also for either form but more typically for the
-         :class:`_expression.Insert`
-         construct, a tuple that contains an entry for every column in the
-         table is also accepted::
+         :class:`_expression.Insert` construct, a tuple that contains an
+         entry for every column in the table is also accepted::
 
             users.insert().values((5, "some name"))
 
-         The :class:`_expression.Insert`
-         construct also supports being passed a list
-         of dictionaries or full-table-tuples, which on the server will
-         render the less common SQL syntax of "multiple values" - this
-         syntax is supported on backends such as SQLite, PostgreSQL, MySQL,
-         but not necessarily others::
+         The :class:`_expression.Insert` construct also supports being
+         passed a list of dictionaries or full-table-tuples, which on the
+         server will render the less common SQL syntax of "multiple values" -
+         this syntax is supported on backends such as SQLite, PostgreSQL,
+         MySQL, but not necessarily others::
 
             users.insert().values([
                                 {"name": "some name"},
@@ -329,7 +327,7 @@ class ValuesBase(UpdateBase):
          construct supports a special form which is a
          list of 2-tuples, which when provided must be passed in conjunction
          with the
-         :paramref:`~sqlalchemy.sql.expression.update.preserve_parameter_order`
+         :paramref:`_expression.update.preserve_parameter_order`
          parameter.
          This form causes the UPDATE statement to render the SET clauses
          using the order of parameters given to
@@ -338,13 +336,13 @@ class ValuesBase(UpdateBase):
 
            .. versionadded:: 1.0.10 - added support for parameter-ordered
               UPDATE statements via the
-              :paramref:`~sqlalchemy.sql.expression.update.preserve_parameter_order`
+              :paramref:`_expression.update.preserve_parameter_order`
               flag.
 
            .. seealso::
 
               :ref:`updates_order_parameters` - full example of the
-              :paramref:`~sqlalchemy.sql.expression.update.preserve_parameter_order`
+              :paramref:`_expression.update.preserve_parameter_order`
               flag
 
         .. seealso::
@@ -429,8 +427,8 @@ class ValuesBase(UpdateBase):
         added to any existing RETURNING clause, provided that
         :meth:`.UpdateBase.returning` is not used simultaneously.  The column
         values will then be available on the result using the
-        :attr:`_engine.ResultProxy.returned_defaults` accessor as a dictionary
-        ,
+        :attr:`_engine.ResultProxy.returned_defaults` accessor as
+        a dictionary,
         referring to values keyed to the :class:`_schema.Column`
         object as well as
         its ``.key``.
@@ -523,10 +521,9 @@ class Insert(ValuesBase):
         :param values: collection of values to be inserted; see
          :meth:`_expression.Insert.values`
          for a description of allowed formats here.
-         Can be omitted entirely; a :class:`_expression.Insert`
-         construct will also
-         dynamically render the VALUES clause at execution time based on
-         the parameters passed to :meth:`_engine.Connection.execute`.
+         Can be omitted entirely; a :class:`_expression.Insert` construct
+         will also dynamically render the VALUES clause at execution time
+         based on the parameters passed to :meth:`_engine.Connection.execute`.
 
         :param inline: if True, no attempt will be made to retrieve the
          SQL-generated default values to be provided within the statement;
@@ -808,7 +805,7 @@ class Update(ValuesBase):
 
     @_generative
     def where(self, whereclause):
-        """return a new update() construct with the given expression added to
+        """Return a new update() construct with the given expression added to
         its WHERE clause, joined to the existing clause via AND, if any.
 
         """
index 9251894787ff399904235bb11087510d84c64d56..91b5f9fe614a075df3cd8c3edef917fefe054e3d 100644 (file)
@@ -262,21 +262,21 @@ class ClauseElement(Visitable):
         return d
 
     def _annotate(self, values):
-        """return a copy of this ClauseElement with annotations
+        """Return a copy of this ClauseElement with annotations
         updated by the given dictionary.
 
         """
         return Annotated(self, values)
 
     def _with_annotations(self, values):
-        """return a copy of this ClauseElement with annotations
+        """Return a copy of this ClauseElement with annotations
         replaced by the given dictionary.
 
         """
         return Annotated(self, values)
 
     def _deannotate(self, values=None, clone=False):
-        """return a copy of this :class:`_expression.ClauseElement`
+        """Return a copy of this :class:`_expression.ClauseElement`
         with annotations
         removed.
 
@@ -300,9 +300,11 @@ class ClauseElement(Visitable):
             raise exc.ObjectNotExecutableError(self)
 
     def unique_params(self, *optionaldict, **kwargs):
-        """Return a copy with :func:`bindparam()` elements replaced.
+        """Return a copy with :func:`_expression.bindparam` elements
+        replaced.
 
-        Same functionality as ``params()``, except adds `unique=True`
+        Same functionality as :meth:`_expression.ClauseElement.params`,
+        except adds `unique=True`
         to affected bind parameters so that multiple statements can be
         used.
 
@@ -310,9 +312,11 @@ class ClauseElement(Visitable):
         return self._params(True, optionaldict, kwargs)
 
     def params(self, *optionaldict, **kwargs):
-        """Return a copy with :func:`bindparam()` elements replaced.
+        """Return a copy with :func:`_expression.bindparam` elements
+        replaced.
 
-        Returns a copy of this ClauseElement with :func:`bindparam()`
+        Returns a copy of this ClauseElement with
+        :func:`_expression.bindparam`
         elements replaced with values taken from the given dictionary::
 
           >>> clause = column('x') + bindparam('foo')
@@ -342,14 +346,15 @@ class ClauseElement(Visitable):
         return cloned_traverse(self, {}, {"bindparam": visit_bindparam})
 
     def compare(self, other, **kw):
-        r"""Compare this ClauseElement to the given ClauseElement.
+        r"""Compare this :class:`_expression.ClauseElement` to
+        the given :class:`_expression.ClauseElement`.
 
         Subclasses should override the default behavior, which is a
         straight identity comparison.
 
-        \**kw are arguments consumed by subclass compare() methods and
-        may be used to modify the criteria for comparison.
-        (see :class:`_expression.ColumnElement`)
+        \**kw are arguments consumed by subclass ``compare()`` methods and
+        may be used to modify the criteria for comparison
+        (see :class:`_expression.ColumnElement`).
 
         """
         return self is other
@@ -385,15 +390,15 @@ class ClauseElement(Visitable):
     def self_group(self, against=None):
         """Apply a 'grouping' to this :class:`_expression.ClauseElement`.
 
-        This method is overridden by subclasses to return a
-        "grouping" construct, i.e. parenthesis.   In particular
-        it's used by "binary" expressions to provide a grouping
-        around themselves when placed into a larger expression,
-        as well as by :func:`_expression.select` constructs when placed into
-        the FROM clause of another :func:`_expression.select`.  (Note that
-        subqueries should be normally created using the
-        :meth:`_expression.Select.alias` method, as many platforms require
-        nested SELECT statements to be named).
+        This method is overridden by subclasses to return a "grouping"
+        construct, i.e. parenthesis.   In particular it's used by "binary"
+        expressions to provide a grouping around themselves when placed into a
+        larger expression, as well as by :func:`_expression.select`
+        constructs when placed into the FROM clause of another
+        :func:`_expression.select`.  (Note that subqueries should be
+        normally created using the :meth:`_expression.Select.alias` method,
+        as many
+        platforms require nested SELECT statements to be named).
 
         As expressions are composed together, the application of
         :meth:`self_group` is automatic - end-user code should never
@@ -498,8 +503,7 @@ class ClauseElement(Visitable):
         ":meth:`_expression.ColumnElement.__and__`.",
     )
     def __and__(self, other):
-        """'and' at the ClauseElement level.
-        """
+        """'and' at the ClauseElement level."""
         return and_(self, other)
 
     @util.deprecated(
@@ -511,8 +515,7 @@ class ClauseElement(Visitable):
         ":meth:`_expression.ColumnElement.__or__`.",
     )
     def __or__(self, other):
-        """'or' at the ClauseElement level.
-        """
+        """'or' at the ClauseElement level."""
         return or_(self, other)
 
     def __invert__(self):
@@ -649,12 +652,12 @@ class ColumnElement(operators.ColumnOperators, ClauseElement):
     """
 
     key = None
-    """the 'key' that in some circumstances refers to this object in a
+    """The 'key' that in some circumstances refers to this object in a
     Python namespace.
 
     This typically refers to the "key" of the column as present in the
-    ``.c`` collection of a selectable, e.g. sometable.c["somekey"] would
-    return a Column with a .key of "somekey".
+    ``.c`` collection of a selectable, e.g. ``sometable.c["somekey"]`` would
+    return a :class:`_schema.Column` with a ``.key`` of "somekey".
 
     """
 
@@ -844,6 +847,7 @@ class ColumnElement(operators.ColumnOperators, ClauseElement):
 
         else:
             key = name
+
         co = ColumnClause(
             _as_truncated(name) if name_is_truncatable else name,
             type_=getattr(self, "type", None),
@@ -906,21 +910,21 @@ class ColumnElement(operators.ColumnOperators, ClauseElement):
 
         This is a shortcut to the :func:`_expression.label` function.
 
-        if 'name' is None, an anonymous label name will be generated.
+        If 'name' is ``None``, an anonymous label name will be generated.
 
         """
         return Label(name, self, self.type)
 
     @util.memoized_property
     def anon_label(self):
-        """provides a constant 'anonymous label' for this ColumnElement.
+        """Provides a constant 'anonymous label' for this ColumnElement.
 
         This is a label() expression which will be named at compile time.
-        The same label() is returned each time anon_label is called so
-        that expressions can reference anon_label multiple times, producing
-        the same label name at compile time.
+        The same label() is returned each time ``anon_label`` is called so
+        that expressions can reference ``anon_label`` multiple times,
+        producing the same label name at compile time.
 
-        the compiler uses this function automatically at compile time
+        The compiler uses this function automatically at compile time
         for expressions that are known to be 'unnamed' like binary
         expressions and function calls.
 
@@ -1065,12 +1069,11 @@ class BindParameter(ColumnElement):
         while the placeholder ``:name_1`` is rendered in the appropriate form
         for the target database, in this case the PostgreSQL database.
 
-        Similarly, :func:`.bindparam` is invoked automatically
-        when working with :term:`CRUD` statements as far as the "VALUES"
-        portion is concerned.   The :func:`_expression.insert`
-        construct produces an
-        ``INSERT`` expression which will, at statement execution time,
-        generate bound placeholders based on the arguments passed, as in::
+        Similarly, :func:`.bindparam` is invoked automatically when working
+        with :term:`CRUD` statements as far as the "VALUES" portion is
+        concerned.   The :func:`_expression.insert` construct produces an
+        ``INSERT`` expression which will, at statement execution time, generate
+        bound placeholders based on the arguments passed, as in::
 
             stmt = users_table.insert()
             result = connection.execute(stmt, name='Wendy')
@@ -1080,11 +1083,10 @@ class BindParameter(ColumnElement):
             INSERT INTO "user" (name) VALUES (%(name)s)
             {'name': 'Wendy'}
 
-        The :class:`_expression.Insert` construct,
-        at compilation/execution time,
-        rendered a single :func:`.bindparam` mirroring the column
-        name ``name`` as a result of the single ``name`` parameter
-        we passed to the :meth:`_engine.Connection.execute` method.
+        The :class:`_expression.Insert` construct, at
+        compilation/execution time, rendered a single :func:`.bindparam`
+        mirroring the column name ``name`` as a result of the single ``name``
+        parameter we passed to the :meth:`_engine.Connection.execute` method.
 
         :param key:
           the key (e.g. the name) for this bind param.
@@ -1185,6 +1187,7 @@ class BindParameter(ColumnElement):
             :func:`.outparam`
 
         """
+
         if isinstance(key, ColumnClause):
             type_ = key.type
             key = key.key
@@ -1249,6 +1252,7 @@ class BindParameter(ColumnElement):
     def _with_value(self, value):
         """Return a copy of this :class:`.BindParameter` with the given value
         set.
+
         """
         cloned = self._clone()
         cloned.value = value
@@ -1290,7 +1294,9 @@ class BindParameter(ColumnElement):
 
     def compare(self, other, **kw):
         """Compare this :class:`BindParameter` to the given
-        clause."""
+        clause.
+
+        """
 
         return (
             isinstance(other, BindParameter)
@@ -1300,7 +1306,7 @@ class BindParameter(ColumnElement):
         )
 
     def __getstate__(self):
-        """execute a deferred value for serialization purposes."""
+        """Execute a deferred value for serialization purposes."""
 
         d = self.__dict__.copy()
         v = self.value
@@ -1507,7 +1513,7 @@ class TextClause(Executable, ClauseElement):
         be eligible for autocommit if no transaction is in progress.
 
         :param text:
-          the text of the SQL statement to be created.  use ``:<param>``
+          the text of the SQL statement to be created.  Use ``:<param>``
           to specify bind parameters; they will be compiled to their
           engine-specific format.
 
@@ -1688,7 +1694,7 @@ class TextClause(Executable, ClauseElement):
 
     @util.dependencies("sqlalchemy.sql.selectable")
     def columns(self, selectable, *cols, **types):
-        """Turn this :class:`_expression.TextClause` object into a
+        r"""Turn this :class:`_expression.TextClause` object into a
         :class:`.TextAsFrom`
         object that can be embedded into another statement.
 
@@ -2119,7 +2125,7 @@ class BooleanClauseList(ClauseList, ColumnElement):
 
     @classmethod
     def and_(cls, *clauses):
-        """Produce a conjunction of expressions joined by ``AND``.
+        r"""Produce a conjunction of expressions joined by ``AND``.
 
         E.g.::
 
@@ -2149,8 +2155,8 @@ class BooleanClauseList(ClauseList, ColumnElement):
         clause being combined using :func:`.and_`::
 
             stmt = select([users_table]).\
-                        where(users_table.c.name == 'wendy').\
-                        where(users_table.c.enrolled == True)
+                    where(users_table.c.name == 'wendy').\
+                    where(users_table.c.enrolled == True)
 
         .. seealso::
 
@@ -2495,7 +2501,7 @@ def literal_column(text, type_=None):
     :param type\_: an optional :class:`~sqlalchemy.types.TypeEngine`
       object which will
       provide result-set translation and additional expression semantics for
-      this column. If left as None the type will be NullType.
+      this column. If left as ``None`` the type will be :class:`.NullType`.
 
     .. seealso::
 
@@ -2843,8 +2849,8 @@ class UnaryExpression(ColumnElement):
 
             from sqlalchemy import desc, nullsfirst
 
-            stmt = select([users_table]).\
-                        order_by(nullsfirst(desc(users_table.c.name)))
+            stmt = select([users_table]).order_by(
+                nullsfirst(desc(users_table.c.name)))
 
         The SQL expression from the above would resemble::
 
@@ -2856,9 +2862,8 @@ class UnaryExpression(ColumnElement):
         rather than as its standalone
         function version, as in::
 
-            stmt = (select([users_table]).
-                    order_by(users_table.c.name.desc().nullsfirst())
-                    )
+            stmt = select([users_table]).order_by(
+                users_table.c.name.desc().nullsfirst())
 
         .. seealso::
 
@@ -2888,8 +2893,8 @@ class UnaryExpression(ColumnElement):
 
             from sqlalchemy import desc, nullslast
 
-            stmt = select([users_table]).\
-                        order_by(nullslast(desc(users_table.c.name)))
+            stmt = select([users_table]).order_by(
+                nullslast(desc(users_table.c.name)))
 
         The SQL expression from the above would resemble::
 
@@ -2901,8 +2906,8 @@ class UnaryExpression(ColumnElement):
         rather than as its standalone
         function version, as in::
 
-            stmt = select([users_table]).\
-                        order_by(users_table.c.name.desc().nullslast())
+            stmt = select([users_table]).order_by(
+                users_table.c.name.desc().nullslast())
 
         .. seealso::
 
@@ -3456,7 +3461,7 @@ class Over(ColumnElement):
             ROW_NUMBER() OVER(ORDER BY some_column
             RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
 
-        A value of None indicates "unbounded", a
+        A value of ``None`` indicates "unbounded", a
         value of zero indicates "current row", and negative / positive
         integers indicate "preceding" and "following":
 
@@ -3488,8 +3493,8 @@ class Over(ColumnElement):
          of such, that will be used as the ORDER BY clause
          of the OVER construct.
         :param range\_: optional range clause for the window.  This is a
-         tuple value which can contain integer values or None, and will
-         render a RANGE BETWEEN PRECEDING / FOLLOWING clause
+         tuple value which can contain integer values or ``None``,
+         and will render a RANGE BETWEEN PRECEDING / FOLLOWING clause.
 
          .. versionadded:: 1.1
 
@@ -4478,7 +4483,7 @@ class conv(_truncated_label):
 
 
 class _defer_name(_truncated_label):
-    """mark a name as 'deferred' for the purposes of automated name
+    """Mark a name as 'deferred' for the purposes of automated name
     generation.
 
     """
@@ -4498,7 +4503,7 @@ class _defer_name(_truncated_label):
 
 
 class _defer_none_name(_defer_name):
-    """indicate a 'deferred' name that was ultimately the value None."""
+    """Indicate a 'deferred' name that was ultimately the value None."""
 
     __slots__ = ()
 
@@ -4542,11 +4547,12 @@ class _anonymous_label(_truncated_label):
 
 
 def _as_truncated(value):
-    """coerce the given value to :class:`._truncated_label`.
+    """Coerce the given value to :class:`._truncated_label`.
 
     Existing :class:`._truncated_label` and
     :class:`._anonymous_label` objects are passed
     unchanged.
+
     """
 
     if isinstance(value, _truncated_label):
@@ -4566,7 +4572,7 @@ def _string_or_unprintable(element):
 
 
 def _expand_cloned(elements):
-    """expand the given set of ClauseElements to be the set of all 'cloned'
+    """Expand the given set of ClauseElements to be the set of all 'cloned'
     predecessors.
 
     """
@@ -4574,7 +4580,7 @@ def _expand_cloned(elements):
 
 
 def _select_iterables(elements):
-    """expand tables into individual columns in the
+    """Expand tables into individual columns in the
     given list of column expressions.
 
     """
@@ -4582,7 +4588,7 @@ def _select_iterables(elements):
 
 
 def _cloned_intersection(a, b):
-    """return the intersection of sets a and b, counting
+    """Return the intersection of sets a and b, counting
     any overlap between 'cloned' predecessors.
 
     The returned set is in terms of the entities present within 'a'.
@@ -4613,13 +4619,13 @@ def _labeled(functions, element):
 
 def _is_column(col):
     """True if ``col`` is an instance of
-    :class:`_expression.ColumnElement`. """
+    :class:`_expression.ColumnElement`."""
 
     return isinstance(col, ColumnElement)
 
 
 def _find_columns(clause):
-    """locate Column objects within the given expression."""
+    """Locate Column objects within the given expression."""
 
     cols = util.column_set()
     traverse(clause, {}, {"column": cols.add})
@@ -4871,17 +4877,17 @@ class AnnotatedColumnElement(Annotated):
 
     @util.memoized_property
     def name(self):
-        """pull 'name' from parent, if not present"""
+        """Pull 'name' from parent, if not present"""
         return self._Annotated__element.name
 
     @util.memoized_property
     def table(self):
-        """pull 'table' from parent, if not present"""
+        """Pull 'table' from parent, if not present"""
         return self._Annotated__element.table
 
     @util.memoized_property
     def key(self):
-        """pull 'key' from parent, if not present"""
+        """Pull 'key' from parent, if not present"""
         return self._Annotated__element.key
 
     @util.memoized_property
index f9fd5a8a05514d4b9ff0eb0639210a7dbf642e27..ab576bf95d04d2a341632d706ec47fb70ec234c0 100644 (file)
@@ -64,7 +64,7 @@ def register_function(identifier, fn, package="_default"):
         if raw_identifier in case_sensitive_reg[identifier]:
             util.warn(
                 "The GenericFunction '{}' is already registered and "
-                "is going to be overriden.".format(identifier)
+                "is going to be overridden.".format(identifier)
             )
             reg[identifier] = fn
         else:
@@ -159,7 +159,7 @@ class FunctionElement(Executable, ColumnElement, FromClause):
 
     @property
     def columns(self):
-        """The set of columns exported by this :class:`.FunctionElement`.
+        r"""The set of columns exported by this :class:`.FunctionElement`.
 
         Function objects currently have no result column names built in;
         this method returns a single-element column collection with
@@ -943,7 +943,7 @@ class user(AnsiFunction):
 
 
 class array_agg(GenericFunction):
-    """support for the ARRAY_AGG function.
+    """Support for the ARRAY_AGG function.
 
     The ``func.array_agg(expr)`` construct returns an expression of
     type :class:`_types.ARRAY`.
@@ -996,7 +996,7 @@ class OrderedSetAgg(GenericFunction):
 
 
 class mode(OrderedSetAgg):
-    """implement the ``mode`` ordered-set aggregate function.
+    """Implement the ``mode`` ordered-set aggregate function.
 
     This function must be used with the :meth:`.FunctionElement.within_group`
     modifier to supply a sort expression to operate upon.
@@ -1009,7 +1009,7 @@ class mode(OrderedSetAgg):
 
 
 class percentile_cont(OrderedSetAgg):
-    """implement the ``percentile_cont`` ordered-set aggregate function.
+    """Implement the ``percentile_cont`` ordered-set aggregate function.
 
     This function must be used with the :meth:`.FunctionElement.within_group`
     modifier to supply a sort expression to operate upon.
@@ -1026,7 +1026,7 @@ class percentile_cont(OrderedSetAgg):
 
 
 class percentile_disc(OrderedSetAgg):
-    """implement the ``percentile_disc`` ordered-set aggregate function.
+    """Implement the ``percentile_disc`` ordered-set aggregate function.
 
     This function must be used with the :meth:`.FunctionElement.within_group`
     modifier to supply a sort expression to operate upon.
index f3482e34038d340234d15e840235ec94c05acee4..d3cc749aa383fe30752dee0ab2897013d1d9d386 100644 (file)
@@ -124,7 +124,7 @@ class Operators(object):
     def op(
         self, opstring, precedence=0, is_comparison=False, return_type=None
     ):
-        """produce a generic operator function.
+        """Produce a generic operator function.
 
         e.g.::
 
@@ -726,7 +726,7 @@ class ColumnOperators(Operators):
 
             somecolumn LIKE :param || '%' ESCAPE '/'
 
-          With the value of :param as ``"foo/%bar"``.
+          With the value of ``:param`` as ``"foo/%bar"``.
 
           .. versionadded:: 1.2
 
@@ -814,7 +814,7 @@ class ColumnOperators(Operators):
 
             somecolumn LIKE '%' || :param ESCAPE '/'
 
-          With the value of :param as ``"foo/%bar"``.
+          With the value of ``:param`` as ``"foo/%bar"``.
 
           .. versionadded:: 1.2
 
@@ -902,7 +902,7 @@ class ColumnOperators(Operators):
 
             somecolumn LIKE '%' || :param || '%' ESCAPE '/'
 
-          With the value of :param as ``"foo/%bar"``.
+          With the value of ``:param`` as ``"foo/%bar"``.
 
           .. versionadded:: 1.2
 
index 891bdb00e5d862ebec167aac7a15ded6a6ac4b03..897beaf94fdef3511ff7b1ac4220088d89d6f59a 100644 (file)
@@ -345,7 +345,8 @@ class Table(DialectKWArgs, SchemaItem, TableClause):
     :param implicit_returning: True by default - indicates that
         RETURNING can be used by default to fetch newly inserted primary key
         values, for backends which support this.  Note that
-        create_engine() also provides an implicit_returning flag.
+        :func:`_sa.create_engine` also provides an ``implicit_returning``
+        flag.
 
     :param include_columns: A list of strings indicating a subset of
         columns to be loaded via the ``autoload`` operation; table columns who
@@ -1321,13 +1322,13 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause):
                 :ref:`server_defaults` - complete discussion of server side
                 defaults
 
-        :param server_onupdate:   A :class:`.FetchedValue` instance
-             representing a database-side default generation function,
-             such as a trigger. This
-             indicates to SQLAlchemy that a newly generated value will be
-             available after updates. This construct does not actually
-             implement any kind of generation function within the database,
-             which instead must be specified separately.
+        :param server_onupdate: A :class:`.FetchedValue` instance
+            representing a database-side default generation function,
+            such as a trigger. This
+            indicates to SQLAlchemy that a newly generated value will be
+            available after updates. This construct does not actually
+            implement any kind of generation function within the database,
+            which instead must be specified separately.
 
             .. seealso::
 
@@ -1615,7 +1616,7 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause):
     def copy(self, **kw):
         """Create a copy of this ``Column``, uninitialized.
 
-        This is used in ``Table.tometadata``.
+        This is used in :meth:`_schema.Table.tometadata`.
 
         """
 
@@ -2296,7 +2297,7 @@ class ColumnDefault(DefaultGenerator):
     """
 
     def __init__(self, arg, **kwargs):
-        """"Construct a new :class:`.ColumnDefault`.
+        """Construct a new :class:`.ColumnDefault`.
 
 
         :param arg: argument representing the default value.
@@ -2430,7 +2431,7 @@ class IdentityOptions(object):
          or minvalue has been reached.
         :param cache: optional integer value; number of future values in the
          sequence which are calculated in advance.
-        :param order: optional boolean value; if true, renders the
+        :param order: optional boolean value; if ``True``, renders the
          ORDER keyword.
          name.
         """
@@ -2571,7 +2572,7 @@ class Sequence(IdentityOptions, DefaultGenerator):
 
          .. versionadded:: 1.1.12
 
-        :param order: optional boolean value; if true, renders the
+        :param order: optional boolean value; if ``True``, renders the
          ORDER keyword, understood by Oracle, indicating the sequence is
          definitively ordered.   May be necessary to provide deterministic
          ordering using Oracle RAC.
@@ -3437,7 +3438,7 @@ class ForeignKeyConstraint(ColumnCollectionConstraint):
         This list is either the original string arguments sent
         to the constructor of the :class:`_schema.ForeignKeyConstraint`,
         or if the constraint has been initialized with :class:`_schema.Column`
-        objects, is the string .key of each element.
+        objects, is the string ``.key`` of each element.
 
         .. versionadded:: 1.0.0
 
@@ -3989,12 +3990,14 @@ class MetaData(SchemaItem):
 
         :param bind:
           An Engine or Connection to bind to.  May also be a string or URL
-          instance, these are passed to create_engine() and this MetaData will
+          instance, these are passed to :func:`_sa.create_engine` and
+          this :class:`_schema.MetaData` will
           be bound to the resulting engine.
 
         :param reflect:
           Optional, automatically load all tables from the bound database.
-          Defaults to False. ``bind`` is required when this option is set.
+          Defaults to False. :paramref:`_schema.MetaData.bind` is required
+          when this option is set.
 
         :param schema:
            The default schema to use for the :class:`_schema.Table`,
@@ -4737,15 +4740,15 @@ class Computed(FetchedValue, SchemaItem):
           Optional, controls how this column should be persisted by the
           database.   Possible values are:
 
-          * None, the default, it will use the default persistence defined
-            by the database.
-          * True, will render ``GENERATED ALWAYS AS ... STORED``, or the
-            equivalent for the target database if supported
-          * False, will render ``GENERATED ALWAYS AS ... VIRTUAL``, or the
+          * ``None``, the default, it will use the default persistence
+            defined by the database.
+          * ``True``, will render ``GENERATED ALWAYS AS ... STORED``, or the
             equivalent for the target database if supported.
+          * ``False``, will render ``GENERATED ALWAYS AS ... VIRTUAL``, or
+            the equivalent for the target database if supported.
 
           Specifying ``True`` or ``False`` may raise an error when the DDL
-          is emitted to the target database if the databse does not support
+          is emitted to the target database if the database does not support
           that persistence option.   Leaving this parameter at its default
           of ``None`` is guaranteed to succeed for all databases that support
           ``GENERATED ALWAYS AS``.
index db5fae50fe5a9929fead43a84c47b97fac70018e..56962271b6bf40aef0571ea0573d9b7cdba2a206 100644 (file)
@@ -127,20 +127,17 @@ def subquery(alias, *args, **kwargs):
     r"""Return an :class:`_expression.Alias` object derived
     from a :class:`_expression.Select`.
 
-    name
-      alias name
+    :param alias: the alias name
 
-    \*args, \**kwargs
-
-      all other arguments are delivered to the
-      :func:`select` function.
+    :param \*args, \**kwargs:  all other arguments are delivered to the
+     :func:`_expression.select` function.
 
     """
     return Select(*args, **kwargs).alias(alias)
 
 
 class Selectable(ClauseElement):
-    """mark a class as being selectable"""
+    """Mark a class as being selectable."""
 
     __visit_name__ = "selectable"
 
@@ -282,7 +279,7 @@ class FromClause(Selectable):
     _is_lateral = False
 
     _textual = False
-    """a marker that allows us to easily distinguish a :class:`.TextAsFrom`
+    """A marker that allows us to easily distinguish a :class:`.TextAsFrom`
     or similar object from other kinds of :class:`_expression.FromClause`
     objects."""
 
@@ -309,7 +306,7 @@ class FromClause(Selectable):
     )
     @util.dependencies("sqlalchemy.sql.functions")
     def count(self, functions, whereclause=None, **params):
-        """return a SELECT COUNT generated against this
+        """Return a SELECT COUNT generated against this
         :class:`_expression.FromClause`.
 
         .. seealso::
@@ -330,7 +327,7 @@ class FromClause(Selectable):
         )
 
     def select(self, whereclause=None, **params):
-        """return a SELECT of this :class:`_expression.FromClause`.
+        """Return a SELECT of this :class:`_expression.FromClause`.
 
         .. seealso::
 
@@ -343,8 +340,8 @@ class FromClause(Selectable):
 
     def join(self, right, onclause=None, isouter=False, full=False):
         """Return a :class:`_expression.Join` from this
-        :class:`_expression.FromClause`
-        to another :class:`FromClause`.
+        :class:`_expression.FromClause` to another
+        :class:`_expression.FromClause`.
 
         E.g.::
 
@@ -434,7 +431,7 @@ class FromClause(Selectable):
         return Join(self, right, onclause, True, full)
 
     def alias(self, name=None, flat=False):
-        """return an alias of this :class:`_expression.FromClause`.
+        """Return an alias of this :class:`_expression.FromClause`.
 
         E.g.::
 
@@ -486,8 +483,8 @@ class FromClause(Selectable):
         return TableSample._construct(self, sampling, name, seed)
 
     def is_derived_from(self, fromclause):
-        """Return True if this FromClause is 'derived' from the given
-        FromClause.
+        """Return ``True`` if this :class:`_expression.FromClause` is
+        'derived' from the given ``FromClause``.
 
         An example would be an Alias of a Table is derived from that Table.
 
@@ -498,8 +495,8 @@ class FromClause(Selectable):
         return fromclause in self._cloned_set
 
     def _is_lexical_equivalent(self, other):
-        """Return True if this FromClause and the other represent
-        the same lexical identity.
+        """Return ``True`` if this :class:`_expression.FromClause` and
+        the other represent the same lexical identity.
 
         This tests if either one is a copy of the other, or
         if they are the same via annotation identity.
@@ -509,7 +506,7 @@ class FromClause(Selectable):
 
     @util.dependencies("sqlalchemy.sql.util")
     def replace_selectable(self, sqlutil, old, alias):
-        """replace all occurrences of FromClause 'old' with the given Alias
+        """Replace all occurrences of FromClause 'old' with the given Alias
         object, returning a copy of this :class:`_expression.FromClause`.
 
         """
@@ -619,7 +616,7 @@ class FromClause(Selectable):
 
     @property
     def description(self):
-        """a brief description of this FromClause.
+        """A brief description of this :class:`_expression.FromClause`.
 
         Used primarily for error message formatting.
 
@@ -627,7 +624,7 @@ class FromClause(Selectable):
         return getattr(self, "name", self.__class__.__name__ + " object")
 
     def _reset_exported(self):
-        """delete memoized collections when a FromClause is cloned."""
+        """Delete memoized collections when a FromClause is cloned."""
 
         self._memoized_property.expire_instance(self)
 
@@ -652,18 +649,20 @@ class FromClause(Selectable):
 
     @_memoized_property
     def primary_key(self):
-        """Return the collection of Column objects which comprise the
-        primary key of this FromClause."""
+        """Return the collection of :class:`_schema.Column` objects
+        which comprise the primary key of this FromClause.
 
+        """
         self._init_collections()
         self._populate_column_collection()
         return self.primary_key
 
     @_memoized_property
     def foreign_keys(self):
-        """Return the collection of ForeignKey objects which this
-        FromClause references."""
+        """Return the collection of :class:`_schema.ForeignKey` objects
+        which this FromClause references.
 
+        """
         self._init_collections()
         self._populate_column_collection()
         return self.foreign_keys
@@ -729,9 +728,8 @@ class FromClause(Selectable):
 
 
 class Join(FromClause):
-    """represent a ``JOIN`` construct between two
-    :class:`_expression.FromClause`
-    elements.
+    """Represent a ``JOIN`` construct between two
+    :class:`_expression.FromClause` elements.
 
     The public constructor function for :class:`_expression.Join`
     is the module-level
@@ -778,7 +776,7 @@ class Join(FromClause):
         The returned object is an instance of :class:`_expression.Join`.
 
         Similar functionality is also available via the
-        :meth:`_expression.FromClause.outerjoin()` method on any
+        :meth:`_expression.FromClause.outerjoin` method on any
         :class:`_expression.FromClause`.
 
         :param left: The left side of the join.
@@ -843,9 +841,9 @@ class Join(FromClause):
         .. seealso::
 
             :meth:`_expression.FromClause.join` - method form,
-            based on a given left side
+            based on a given left side.
 
-            :class:`_expression.Join` - the type of object produced
+            :class:`_expression.Join` - the type of object produced.
 
         """
 
@@ -933,7 +931,7 @@ class Join(FromClause):
         a_subset=None,
         consider_as_foreign_keys=None,
     ):
-        """create a join condition between two tables or selectables.
+        """Create a join condition between two tables or selectables.
 
         e.g.::
 
@@ -1114,7 +1112,7 @@ class Join(FromClause):
 
     @util.dependencies("sqlalchemy.sql.util")
     def alias(self, sqlutil, name=None, flat=False):
-        r"""return an alias of this :class:`_expression.Join`.
+        r"""Return an alias of this :class:`_expression.Join`.
 
         The default behavior here is to first produce a SELECT
         construct from this :class:`_expression.Join`, then to produce an
@@ -1300,23 +1298,21 @@ class Alias(FromClause):
         clause when generated, e.g. ``SELECT * FROM table AS aliasname``.
 
         Similar functionality is available via the
-        :meth:`_expression.FromClause.alias` method
-        available on all :class:`_expression.FromClause` subclasses.
-        In terms of a
-        SELECT object as generated from the :func:`_expression.select`
-        function, the
-        :meth:`_expression.SelectBase.alias` method returns an
-        :class:`_expression.Alias` or
-        similar object which represents a named, parenthesized subquery.
+        :meth:`_expression.FromClause.alias`
+        method available on all :class:`_expression.FromClause` subclasses.
+        In terms of
+        a SELECT object as generated from the :func:`_expression.select`
+        function, the :meth:`_expression.SelectBase.alias` method returns an
+        :class:`_expression.Alias` or similar object which represents a named,
+        parenthesized subquery.
 
         When an :class:`_expression.Alias` is created from a
         :class:`_schema.Table` object,
         this has the effect of the table being rendered
         as ``tablename AS aliasname`` in a SELECT statement.
 
-        For :func:`_expression.select` objects,
-        the effect is that of creating a named
-        subquery, i.e. ``(select ...) AS aliasname``.
+        For :func:`_expression.select` objects, the effect is that of
+        creating a named subquery, i.e. ``(select ...) AS aliasname``.
 
         The ``name`` parameter is optional, and provides the name
         to use in the rendered SQL.  If blank, an "anonymous" name
@@ -1623,7 +1619,7 @@ class CTE(Generative, HasPrefixes, HasSuffixes, Alias):
         :class:`_expression.CTE`.
 
         This method is a CTE-specific specialization of the
-        :class:`_expression.FromClause.alias` method.
+        :meth:`_expression.FromClause.alias` method.
 
         .. seealso::
 
@@ -1702,8 +1698,8 @@ class HasCTE(object):
            In particular - MATERIALIZED and NOT MATERIALIZED.
 
         :param name: name given to the common table expression.  Like
-         :meth:`._FromClause.alias`, the name can be left as ``None``
-         in which case an anonymous symbol will be used at query
+         :meth:`_expression.FromClause.alias`, the name can be left as
+         ``None`` in which case an anonymous symbol will be used at query
          compile time.
         :param recursive: if ``True``, will render ``WITH RECURSIVE``.
          A recursive common table expression is intended to be used in
@@ -1937,8 +1933,8 @@ class TableClause(Immutable, FromClause):
     def __init__(self, name, *columns, **kw):
         """Produce a new :class:`_expression.TableClause`.
 
-        The object returned is an instance of :class:`_expression.TableClause`
-        , which
+        The object returned is an instance of
+        :class:`_expression.TableClause`, which
         represents the "syntactical" portion of the schema-level
         :class:`_schema.Table` object.
         It may be used to construct lightweight table constructs.
@@ -2155,7 +2151,7 @@ class SelectBase(HasCTE, Executable, FromClause):
     """
 
     def as_scalar(self):
-        """return a 'scalar' representation of this selectable, which can be
+        """Return a 'scalar' representation of this selectable, which can be
         used as a column expression.
 
         Typically, a select statement which has only one column in its columns
@@ -2168,7 +2164,7 @@ class SelectBase(HasCTE, Executable, FromClause):
         return ScalarSelect(self)
 
     def label(self, name):
-        """return a 'scalar' representation of this selectable, embedded as a
+        """Return a 'scalar' representation of this selectable, embedded as a
         subquery with a label.
 
         .. seealso::
@@ -2188,8 +2184,9 @@ class SelectBase(HasCTE, Executable, FromClause):
         ":meth:`.Executable.execution_options` method.",
     )
     def autocommit(self):
-        """return a new selectable with the 'autocommit' flag set to
+        """Return a new selectable with the 'autocommit' flag set to
         True.
+
         """
 
         self._execution_options = self._execution_options.union(
@@ -2360,7 +2357,7 @@ class GenerativeSelect(SelectBase):
 
     @_generative
     def apply_labels(self):
-        """return a new selectable with the 'use_labels' flag set to True.
+        """Return a new selectable with the 'use_labels' flag set to True.
 
         This will result in column expressions being generated using labels
         against their table name, such as "SELECT somecolumn AS
@@ -2407,7 +2404,7 @@ class GenerativeSelect(SelectBase):
 
     @_generative
     def limit(self, limit):
-        """return a new selectable with the given LIMIT criterion
+        """Return a new selectable with the given LIMIT criterion
         applied.
 
         This is a numerical value which usually renders as a ``LIMIT``
@@ -2427,7 +2424,7 @@ class GenerativeSelect(SelectBase):
 
     @_generative
     def offset(self, offset):
-        """return a new selectable with the given OFFSET criterion
+        """Return a new selectable with the given OFFSET criterion
         applied.
 
 
@@ -2449,14 +2446,14 @@ class GenerativeSelect(SelectBase):
 
     @_generative
     def order_by(self, *clauses):
-        r"""return a new selectable with the given list of ORDER BY
+        r"""Return a new selectable with the given list of ORDER BY
         criterion applied.
 
         e.g.::
 
             stmt = select([table]).order_by(table.c.id, table.c.name)
 
-        :param \*order_by: a series of :class:`_expression.ColumnElement`
+        :param \*clauses: a series of :class:`_expression.ColumnElement`
          constructs
          which will be used to generate an ORDER BY clause.
 
@@ -2470,7 +2467,7 @@ class GenerativeSelect(SelectBase):
 
     @_generative
     def group_by(self, *clauses):
-        r"""return a new selectable with the given list of GROUP BY
+        r"""Return a new selectable with the given list of GROUP BY
         criterion applied.
 
         e.g.::
@@ -2478,7 +2475,7 @@ class GenerativeSelect(SelectBase):
             stmt = select([table.c.name, func.max(table.c.stat)]).\
             group_by(table.c.name)
 
-        :param \*group_by: a series of :class:`_expression.ColumnElement`
+        :param \*clauses: a series of :class:`_expression.ColumnElement`
          constructs
          which will be used to generate an GROUP BY clause.
 
@@ -2522,8 +2519,7 @@ class GenerativeSelect(SelectBase):
 
         This is an **in-place** mutation method; the
         :meth:`_expression.GenerativeSelect.group_by` method is preferred,
-        as it
-        provides standard :term:`method chaining`.
+        as it provides standard :term:`method chaining`.
 
         .. seealso::
 
@@ -2552,7 +2548,7 @@ class GenerativeSelect(SelectBase):
 
 class CompoundSelect(GenerativeSelect):
     """Forms the basis of ``UNION``, ``UNION ALL``, and other
-        SELECT-based set operations.
+    SELECT-based set operations.
 
 
     .. seealso::
@@ -2628,12 +2624,12 @@ class CompoundSelect(GenerativeSelect):
         A similar :func:`union()` method is available on all
         :class:`_expression.FromClause` subclasses.
 
-        \*selects
+        :param \*selects:
           a list of :class:`_expression.Select` instances.
 
-        \**kwargs
-           available keyword arguments are the same as those of
-           :func:`select`.
+        :param \**kwargs:
+          available keyword arguments are the same as those of
+          :func:`select`.
 
         """
         return CompoundSelect(CompoundSelect.UNION, *selects, **kwargs)
@@ -2648,10 +2644,10 @@ class CompoundSelect(GenerativeSelect):
         A similar :func:`union_all()` method is available on all
         :class:`_expression.FromClause` subclasses.
 
-        \*selects
+        :param \*selects:
           a list of :class:`_expression.Select` instances.
 
-        \**kwargs
+        :param \**kwargs:
           available keyword arguments are the same as those of
           :func:`select`.
 
@@ -2665,10 +2661,10 @@ class CompoundSelect(GenerativeSelect):
         The returned object is an instance of
         :class:`_selectable.CompoundSelect`.
 
-        \*selects
+        :param \*selects:
           a list of :class:`_expression.Select` instances.
 
-        \**kwargs
+        :param \**kwargs:
           available keyword arguments are the same as those of
           :func:`select`.
 
@@ -2682,10 +2678,10 @@ class CompoundSelect(GenerativeSelect):
         The returned object is an instance of
         :class:`_selectable.CompoundSelect`.
 
-        \*selects
+        :param \*selects:
           a list of :class:`_expression.Select` instances.
 
-        \**kwargs
+        :param \**kwargs:
           available keyword arguments are the same as those of
           :func:`select`.
 
@@ -2699,10 +2695,10 @@ class CompoundSelect(GenerativeSelect):
         The returned object is an instance of
         :class:`_selectable.CompoundSelect`.
 
-        \*selects
+        :param \*selects:
           a list of :class:`_expression.Select` instances.
 
-        \**kwargs
+        :param \**kwargs:
           available keyword arguments are the same as those of
           :func:`select`.
 
@@ -2716,10 +2712,10 @@ class CompoundSelect(GenerativeSelect):
         The returned object is an instance of
         :class:`_selectable.CompoundSelect`.
 
-        \*selects
+        :param \*selects:
           a list of :class:`_expression.Select` instances.
 
-        \**kwargs
+        :param \**kwargs:
           available keyword arguments are the same as those of
           :func:`select`.
 
@@ -2817,9 +2813,7 @@ class CompoundSelect(GenerativeSelect):
 
 
 class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
-    """Represents a ``SELECT`` statement.
-
-    """
+    """Represents a ``SELECT`` statement."""
 
     __visit_name__ = "select"
 
@@ -2875,8 +2869,8 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
         All arguments which accept :class:`_expression.ClauseElement`
         arguments also
         accept string arguments, which will be converted as appropriate into
-        either :func:`_expression.text()` or
-        :func:`_expression.literal_column()` constructs.
+        either :func:`_expression.text` or
+        :func:`_expression.literal_column` constructs.
 
         .. seealso::
 
@@ -3066,7 +3060,7 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
           for each column in the columns clause, which qualify each
           column with its parent table's (or aliases) name so that name
           conflicts between columns in different tables don't occur.
-          The format of the label is <tablename>_<column>.  The "c"
+          The format of the label is ``<tablename>_<column>``.  The "c"
           collection of the resulting :class:`_expression.Select`
           object will use these
           names as well for targeting column members.
@@ -3266,7 +3260,7 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
         return self._get_display_froms()
 
     def with_statement_hint(self, text, dialect_name="*"):
-        """add a statement hint to this :class:`_expression.Select`.
+        """Add a statement hint to this :class:`_expression.Select`.
 
         This method is similar to :meth:`_expression.Select.with_hint`
         except that
@@ -3341,7 +3335,8 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
 
     @_memoized_property.method
     def locate_all_froms(self):
-        """return a Set of all FromClause elements referenced by this Select.
+        """Return a Set of all :class:`_expression.FromClause` elements
+        referenced by this Select.
 
         This set is a superset of that returned by the ``froms`` property,
         which is specifically for those FromClause elements that would
@@ -3353,7 +3348,8 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
 
     @property
     def inner_columns(self):
-        """an iterator of all ColumnElement expressions which would
+        """An iterator of all :class:`_expression.ColumnElement`
+        expressions which would
         be rendered into the columns clause of the resulting SELECT statement.
 
         """
@@ -3447,7 +3443,7 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
         self._reset_exported()
 
     def get_children(self, column_collections=True, **kwargs):
-        """return child elements as per the ClauseElement specification."""
+        """Return child elements as per the ClauseElement specification."""
 
         return (
             (column_collections and list(self.columns) or [])
@@ -3467,24 +3463,24 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
 
     @_generative
     def column(self, column):
-        """return a new select() construct with the given column expression
-            added to its columns clause.
+        """Return a new :func:`_expression.select` construct with
+        the given column expression added to its columns clause.
 
-            E.g.::
+        E.g.::
 
-                my_select = my_select.column(table.c.new_column)
+            my_select = my_select.column(table.c.new_column)
 
-            See the documentation for
-            :meth:`_expression.Select.with_only_columns`
-            for guidelines on adding /replacing the columns of a
-            :class:`_expression.Select` object.
+        See the documentation for
+        :meth:`_expression.Select.with_only_columns`
+        for guidelines on adding /replacing the columns of a
+        :class:`_expression.Select` object.
 
         """
         self.append_column(column)
 
     @util.dependencies("sqlalchemy.sql.util")
     def reduce_columns(self, sqlutil, only_synonyms=True):
-        """Return a new :func`.select` construct with redundantly
+        """Return a new :func:`_expression.select` construct with redundantly
         named, equivalently-valued columns removed from the columns clause.
 
         "Redundant" here means two columns where one refers to the
@@ -3492,8 +3488,8 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
         comparison in the WHERE clause of the statement.   The primary purpose
         of this method is to automatically construct a select statement
         with all uniquely-named columns, without the need to use
-        table-qualified labels as :meth:`_expression.Select.apply_labels` does
-        .
+        table-qualified labels as :meth:`_expression.Select.apply_labels`
+        does.
 
         When columns are omitted based on foreign key, the referred-to
         column is the one that's kept.  When columns are omitted based on
@@ -3554,18 +3550,16 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
             >>> print(s2)
             SELECT t2.b FROM t1 JOIN t2 ON t1.a=t2.a
 
-        Care should also be taken to use the correct
-        set of column objects passed to
-        :meth:`_expression.Select.with_only_columns`.
-        Since the method is essentially equivalent to calling the
-        :func:`_expression.select` construct in the first place with the given
-        columns, the columns passed to
-        :meth:`_expression.Select.with_only_columns`
-        should usually be a subset of those which were passed
-        to the :func:`_expression.select` construct,
-        not those which are available
-        from the ``.c`` collection of that :func:`_expression.select`.  That
-        is::
+        Care should also be taken to use the correct set of column objects
+        passed to :meth:`_expression.Select.with_only_columns`.
+        Since the method is
+        essentially equivalent to calling the :func:`_expression.select`
+        construct in the first place with the given columns, the columns passed
+        to :meth:`_expression.Select.with_only_columns`
+        should usually be a subset of
+        those which were passed to the :func:`_expression.select`
+        construct, not those which are available from the ``.c`` collection of
+        that :func:`_expression.select`.  That is::
 
             s = select([table1.c.a, table1.c.b]).select_from(table1)
             s = s.with_only_columns([table1.c.b])
@@ -3581,8 +3575,8 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
             FROM (SELECT t1.a AS a, t1.b AS b
             FROM t1), t1
 
-        Since the :func:`_expression.select` construct is essentially being
-        asked to select both from ``table1`` as well as itself.
+        Since the :func:`_expression.select` construct is essentially
+        being asked to select both from ``table1`` as well as itself.
 
         """
         self._reset_exported()
@@ -3596,7 +3590,8 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
 
     @_generative
     def where(self, whereclause):
-        """return a new select() construct with the given expression added to
+        """Return a new :func:`_expression.select` construct with
+        the given expression added to
         its WHERE clause, joined to the existing clause via AND, if any.
 
         """
@@ -3605,7 +3600,8 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
 
     @_generative
     def having(self, having):
-        """return a new select() construct with the given expression added to
+        """Return a new :func:`_expression.select` construct with
+        the given expression added to
         its HAVING clause, joined to the existing clause via AND, if any.
 
         """
@@ -3613,8 +3609,8 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
 
     @_generative
     def distinct(self, *expr):
-        r"""Return a new select() construct which will apply DISTINCT to its
-        columns clause.
+        r"""Return a new :func:`_expression.select` construct which
+        will apply DISTINCT to its columns clause.
 
         :param \*expr: optional column expressions.  When present,
          the PostgreSQL dialect will render a ``DISTINCT ON (<expressions>>)``
@@ -3632,8 +3628,8 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
 
     @_generative
     def select_from(self, fromclause):
-        r"""return a new :func:`_expression.select` construct with the
-        given FROM expression
+        r"""Return a new :func:`_expression.select` construct with the
+        given FROM expression(s)
         merged into its list of FROM objects.
 
         E.g.::
@@ -3669,7 +3665,7 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
 
     @_generative
     def correlate(self, *fromclauses):
-        r"""return a new :class:`_expression.Select`
+        r"""Return a new :class:`_expression.Select`
         which will correlate the given FROM
         clauses to that of an enclosing :class:`_expression.Select`.
 
@@ -3719,6 +3715,7 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
             :ref:`correlated_subqueries`
 
         """
+
         self._auto_correlate = False
         if fromclauses and fromclauses[0] is None:
             self._correlate = ()
@@ -3729,7 +3726,7 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
 
     @_generative
     def correlate_except(self, *fromclauses):
-        r"""return a new :class:`_expression.Select`
+        r"""Return a new :class:`_expression.Select`
         which will omit the given FROM
         clauses from the auto-correlation process.
 
@@ -3766,13 +3763,12 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
             )
 
     def append_correlation(self, fromclause):
-        """append the given correlation expression to this select()
-        construct.
+        """Append the given correlation expression to this
+        :func:`_expression.select` construct.
 
         This is an **in-place** mutation method; the
         :meth:`_expression.Select.correlate` method is preferred,
-        as it provides
-        standard :term:`method chaining`.
+        as it provides standard :term:`method chaining`.
 
         """
 
@@ -3782,8 +3778,8 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
         )
 
     def append_column(self, column):
-        """append the given column expression to the columns clause of this
-        select() construct.
+        """Append the given column expression to the columns clause of this
+        :func:`_expression.select` construct.
 
         E.g.::
 
@@ -3791,8 +3787,7 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
 
         This is an **in-place** mutation method; the
         :meth:`_expression.Select.column` method is preferred,
-        as it provides standard
-        :term:`method chaining`.
+        as it provides standard :term:`method chaining`.
 
         See the documentation for :meth:`_expression.Select.with_only_columns`
         for guidelines on adding /replacing the columns of a
@@ -3808,28 +3803,26 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
         self._raw_columns = self._raw_columns + [column]
 
     def append_prefix(self, clause):
-        """append the given columns clause prefix expression to this select()
-        construct.
+        """Append the given columns clause prefix expression to this
+        :func:`_expression.select` construct.
 
         This is an **in-place** mutation method; the
         :meth:`_expression.Select.prefix_with` method is preferred,
-        as it provides
-        standard :term:`method chaining`.
+        as it provides standard :term:`method chaining`.
 
         """
         clause = _literal_as_text(clause)
         self._prefixes = self._prefixes + (clause,)
 
     def append_whereclause(self, whereclause):
-        """append the given expression to this select() construct's WHERE
-        criterion.
+        """Append the given expression to this :func:`_expression.select`
+        construct's WHERE criterion.
 
         The expression will be joined to existing WHERE criterion via AND.
 
         This is an **in-place** mutation method; the
         :meth:`_expression.Select.where` method is preferred,
-        as it provides standard
-        :term:`method chaining`.
+        as it provides standard :term:`method chaining`.
 
         """
 
@@ -3837,28 +3830,26 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
         self._whereclause = and_(True_._ifnone(self._whereclause), whereclause)
 
     def append_having(self, having):
-        """append the given expression to this select() construct's HAVING
-        criterion.
+        """Append the given expression to this :func:`_expression.select`
+        construct's HAVING criterion.
 
         The expression will be joined to existing HAVING criterion via AND.
 
         This is an **in-place** mutation method; the
         :meth:`_expression.Select.having` method is preferred,
-        as it provides standard
-        :term:`method chaining`.
+        as it provides standard :term:`method chaining`.
 
         """
         self._reset_exported()
         self._having = and_(True_._ifnone(self._having), having)
 
     def append_from(self, fromclause):
-        """append the given FromClause expression to this select() construct's
-        FROM clause.
+        """Append the given FromClause expression to this
+        :func:`_expression.select` construct's FROM clause.
 
         This is an **in-place** mutation method; the
         :meth:`_expression.Select.select_from` method is preferred,
-        as it provides
-        standard :term:`method chaining`.
+        as it provides standard :term:`method chaining`.
 
         """
         self._reset_exported()
@@ -3929,8 +3920,8 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
         )
 
     def self_group(self, against=None):
-        """return a 'grouping' construct as per the ClauseElement
-        specification.
+        """Return a 'grouping' construct as per the
+        :class:`_expression.ClauseElement` specification.
 
         This produces an element that can be embedded in an expression. Note
         that this method is called automatically as needed when constructing
@@ -3945,41 +3936,43 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
         return FromGrouping(self)
 
     def union(self, other, **kwargs):
-        """return a SQL UNION of this select() construct against the given
-        selectable."""
+        """Return a SQL ``UNION`` of this select() construct against
+        the given selectable.
 
+        """
         return CompoundSelect._create_union(self, other, **kwargs)
 
     def union_all(self, other, **kwargs):
-        """return a SQL UNION ALL of this select() construct against the given
-        selectable.
+        """Return a SQL ``UNION ALL`` of this select() construct against
+        the given selectable.
 
         """
         return CompoundSelect._create_union_all(self, other, **kwargs)
 
     def except_(self, other, **kwargs):
-        """return a SQL EXCEPT of this select() construct against the given
-        selectable."""
+        """Return a SQL ``EXCEPT`` of this select() construct against
+        the given selectable.
 
+        """
         return CompoundSelect._create_except(self, other, **kwargs)
 
     def except_all(self, other, **kwargs):
-        """return a SQL EXCEPT ALL of this select() construct against the
-        given selectable.
+        """Return a SQL ``EXCEPT ALL`` of this select() construct against
+        the given selectable.
 
         """
         return CompoundSelect._create_except_all(self, other, **kwargs)
 
     def intersect(self, other, **kwargs):
-        """return a SQL INTERSECT of this select() construct against the given
-        selectable.
+        """Return a SQL ``INTERSECT`` of this select() construct against
+        the given selectable.
 
         """
         return CompoundSelect._create_intersect(self, other, **kwargs)
 
     def intersect_all(self, other, **kwargs):
-        """return a SQL INTERSECT ALL of this select() construct against the
-        given selectable.
+        """Return a SQL ``INTERSECT ALL`` of this select() construct
+        against the given selectable.
 
         """
         return CompoundSelect._create_intersect_all(self, other, **kwargs)
@@ -4094,7 +4087,7 @@ class Exists(UnaryExpression):
         return e
 
     def select_from(self, clause):
-        """return a new :class:`_expression.Exists` construct,
+        """Return a new :class:`_expression.Exists` construct,
         applying the given
         expression to the :meth:`_expression.Select.select_from`
         method of the select
@@ -4106,7 +4099,8 @@ class Exists(UnaryExpression):
         return e
 
     def where(self, clause):
-        """return a new exists() construct with the given expression added to
+        """Return a new :func:`_expression.exists` construct with the
+        given expression added to
         its WHERE clause, joined to the existing clause via AND, if any.
 
         """
@@ -4120,8 +4114,8 @@ class TextAsFrom(SelectBase):
     :class:`_expression.SelectBase`
     interface.
 
-    This allows the :class:`_expression.TextClause` object to gain a ``.
-    c`` collection
+    This allows the :class:`_expression.TextClause` object to gain a
+    ``.c`` collection
     and other FROM-like capabilities such as
     :meth:`_expression.FromClause.alias`,
     :meth:`_expression.SelectBase.cte`, etc.
index a8248c791e00969b83404e054ba850504f3f7f4f..7d2ba2a58f9562271780e49ce5f16104f87ebc5f 100644 (file)
@@ -534,7 +534,7 @@ class Numeric(_LookupExpressionAdapter, TypeEngine):
         type that is explicitly known to be a decimal type
         (e.g. ``DECIMAL``, ``NUMERIC``, others) and not a floating point
         type (e.g. ``FLOAT``, ``REAL``, others).
-        If the database column on the server is in fact a floating-point type
+        If the database column on the server is in fact a floating-point
         type, such as ``FLOAT`` or ``REAL``, use the :class:`.Float`
         type or a subclass, otherwise numeric coercion between
         ``float``/``Decimal`` may or may not function as expected.
@@ -1124,7 +1124,7 @@ class SchemaType(SchemaEventTarget):
         return self.metadata and self.metadata.bind or None
 
     def create(self, bind=None, checkfirst=False):
-        """Issue CREATE ddl for this type, if applicable."""
+        """Issue CREATE DDL for this type, if applicable."""
 
         if bind is None:
             bind = _bind_or_error(self)
@@ -1133,7 +1133,7 @@ class SchemaType(SchemaEventTarget):
             t.create(bind=bind, checkfirst=checkfirst)
 
     def drop(self, bind=None, checkfirst=False):
-        """Issue DROP ddl for this type, if applicable."""
+        """Issue DROP DDL for this type, if applicable."""
 
         if bind is None:
             bind = _bind_or_error(self)
@@ -1374,7 +1374,7 @@ class Enum(Emulated, String, SchemaType):
            default, the database value of the enumeration is used as the
            sorting function.
 
-            .. versionadded:: 1.3.8
+           .. versionadded:: 1.3.8
 
 
 
@@ -2179,8 +2179,8 @@ class JSON(Indexable, TypeEngine):
         )
 
     While it is possible to use :attr:`_types.JSON.NULL` in this context, the
-    :attr:`_types.JSON.NULL` value will be returned as the value of the column
-    ,
+    :attr:`_types.JSON.NULL` value will be returned as the value of the
+    column,
     which in the context of the ORM or other repurposing of the default
     value, may not be desirable.  Using a SQL expression means the value
     will be re-fetched from the database within the context of retrieving
@@ -2215,7 +2215,7 @@ class JSON(Indexable, TypeEngine):
         self.none_as_null = none_as_null
 
     class JSONElementType(TypeEngine):
-        """common function for index / path elements in a JSON expression."""
+        """Common function for index / path elements in a JSON expression."""
 
         _integer = Integer()
         _string = String()
@@ -2540,7 +2540,7 @@ class ARRAY(SchemaEventTarget, Indexable, Concatenable, TypeEngine):
     __visit_name__ = "ARRAY"
 
     zero_indexes = False
-    """if True, Python zero-based indexes should be interpreted as one-based
+    """If True, Python zero-based indexes should be interpreted as one-based
     on the SQL expression side."""
 
     class Comparator(Indexable.Comparator, Concatenable.Comparator):
index cf34f0f2a6c29a3acf59f425424e74dc1be6c9da..75d8b9f86ee8310fb08bed48a20b8da0e4f51362 100644 (file)
@@ -332,7 +332,7 @@ class TypeEngine(Visitable):
         )
 
     def bind_expression(self, bindvalue):
-        """"Given a bind value (i.e. a :class:`.BindParameter` instance),
+        """Given a bind value (i.e. a :class:`.BindParameter` instance),
         return a SQL expression in its place.
 
         This is typically a SQL function that wraps the existing bound
@@ -384,7 +384,7 @@ class TypeEngine(Visitable):
         """Return the corresponding type object from the underlying DB-API, if
         any.
 
-         This can be useful for calling ``setinputsizes()``, for example.
+        This can be useful for calling ``setinputsizes()``, for example.
 
         """
         return None
@@ -808,10 +808,10 @@ class TypeDecorator(SchemaEventTarget, TypeEngine):
           def copy(self, **kw):
               return MyType(self.impl.length)
 
-    The class-level "impl" attribute is required, and can reference any
-    TypeEngine class.  Alternatively, the load_dialect_impl() method
-    can be used to provide different type classes based on the dialect
-    given; in this case, the "impl" variable can reference
+    The class-level ``impl`` attribute is required, and can reference any
+    :class:`.TypeEngine` class.  Alternatively, the :meth:`load_dialect_impl`
+    method can be used to provide different type classes based on the dialect
+    given; in this case, the ``impl`` variable can reference
     ``TypeEngine`` as a placeholder.
 
     Types that receive a Python type that isn't similar to the ultimate type
@@ -913,7 +913,7 @@ class TypeDecorator(SchemaEventTarget, TypeEngine):
     coerce_to_is_types = (util.NoneType,)
     """Specify those Python types which should be coerced at the expression
     level to "IS <constant>" when compared using ``==`` (and same for
-    ``IS NOT`` in conjunction with ``!=``.
+    ``IS NOT`` in conjunction with ``!=``).
 
     For most SQLAlchemy types, this includes ``NoneType``, as well as
     ``bool``.
index 8539c099b43fe2ff879348a801ecd94fe440c71c..23be6e8fa3bafbabe26920771fc4b67b509f2653 100644 (file)
@@ -73,6 +73,7 @@ class VisitableType(type):
 def _generate_dispatch(cls):
     """Return an optimized visit dispatch function for the cls
     for use by the compiler.
+
     """
     if "__visit_name__" in cls.__dict__:
         visit_name = cls.__visit_name__
@@ -144,14 +145,14 @@ class ClauseVisitor(object):
                 return meth(obj, **kw)
 
     def iterate(self, obj):
-        """traverse the given expression structure, returning an iterator
+        """Traverse the given expression structure, returning an iterator
         of all elements.
 
         """
         return iterate(obj, self.__traverse_options__)
 
     def traverse(self, obj):
-        """traverse and visit the given expression structure."""
+        """Traverse and visit the given expression structure."""
 
         return traverse(obj, self.__traverse_options__, self._visitor_dict)
 
@@ -166,7 +167,7 @@ class ClauseVisitor(object):
 
     @property
     def visitor_iterator(self):
-        """iterate through this visitor and each 'chained' visitor."""
+        """Iterate through this visitor and each 'chained' visitor."""
 
         v = self
         while v:
@@ -174,9 +175,9 @@ class ClauseVisitor(object):
             v = getattr(v, "_next", None)
 
     def chain(self, visitor):
-        """'chain' an additional ClauseVisitor onto this ClauseVisitor.
+        """'Chain' an additional ClauseVisitor onto this ClauseVisitor.
 
-        the chained visitor will receive all visit events after this one.
+        The chained visitor will receive all visit events after this one.
 
         """
         tail = list(self.visitor_iterator)[-1]
@@ -202,7 +203,7 @@ class CloningVisitor(ClauseVisitor):
         return [self.traverse(x) for x in list_]
 
     def traverse(self, obj):
-        """traverse and visit the given expression structure."""
+        """Traverse and visit the given expression structure."""
 
         return cloned_traverse(
             obj, self.__traverse_options__, self._visitor_dict
@@ -219,7 +220,7 @@ class ReplacingCloningVisitor(CloningVisitor):
     """
 
     def replace(self, elem):
-        """receive pre-copied elements during a cloning traversal.
+        """Receive pre-copied elements during a cloning traversal.
 
         If the method returns a new element, the element is used
         instead of creating a simple copy of the element.  Traversal
@@ -228,7 +229,7 @@ class ReplacingCloningVisitor(CloningVisitor):
         return None
 
     def traverse(self, obj):
-        """traverse and visit the given expression structure."""
+        """Traverse and visit the given expression structure."""
 
         def replace(elem):
             for v in self.visitor_iterator:
@@ -240,22 +241,19 @@ class ReplacingCloningVisitor(CloningVisitor):
 
 
 def iterate(obj, opts):
-    r"""traverse the given expression structure, returning an iterator.
+    r"""Traverse the given expression structure, returning an iterator.
 
-    traversal is configured to be breadth-first.
+    Traversal is configured to be breadth-first.
 
     The central API feature used by the :func:`.visitors.iterate` and
     :func:`.visitors.iterate_depthfirst` functions is the
     :meth:`_expression.ClauseElement.get_children` method of
-    :class:`_expression.ClauseElement`
-    objects.  This method should return all the
-    :class:`_expression.ClauseElement` objects
-    which are associated with a particular :class:`_expression.ClauseElement`
-    object.
-    For example, a :class:`.Case` structure will refer to a series of
-    :class:`_expression.ColumnElement`
-    objects within its "whens" and "else\_" member
-    variables.
+    :class:`_expression.ClauseElement` objects.  This method should return all
+    the :class:`_expression.ClauseElement` objects which are associated with a
+    particular :class:`_expression.ClauseElement` object. For example, a
+    :class:`.Case` structure will refer to a series of
+    :class:`_expression.ColumnElement` objects within its "whens" and "else\_"
+    member variables.
 
     :param obj: :class:`_expression.ClauseElement` structure to be traversed
 
@@ -279,9 +277,9 @@ def iterate(obj, opts):
 
 
 def iterate_depthfirst(obj, opts):
-    """traverse the given expression structure, returning an iterator.
+    """Traverse the given expression structure, returning an iterator.
 
-    traversal is configured to be depth-first.
+    Traversal is configured to be depth-first.
 
     :param obj: :class:`_expression.ClauseElement` structure to be traversed
 
@@ -309,7 +307,7 @@ def iterate_depthfirst(obj, opts):
 
 
 def traverse_using(iterator, obj, visitors):
-    """visit the given expression structure using the given iterator of
+    """Visit the given expression structure using the given iterator of
     objects.
 
     :func:`.visitors.traverse_using` is usually called internally as the result
@@ -344,7 +342,7 @@ def traverse_using(iterator, obj, visitors):
 
 
 def traverse(obj, opts, visitors):
-    """traverse and visit the given expression structure using the default
+    """Traverse and visit the given expression structure using the default
     iterator.
 
      e.g.::
@@ -391,7 +389,7 @@ def traverse_depthfirst(obj, opts, visitors):
 
 
 def cloned_traverse(obj, opts, visitors):
-    """clone the given expression structure, allowing modifications by
+    """Clone the given expression structure, allowing modifications by
     visitors.
 
     Traversal usage is the same as that of :func:`.visitors.traverse`.
@@ -434,21 +432,19 @@ def cloned_traverse(obj, opts, visitors):
 
     if obj is not None:
         obj = clone(obj)
-
     clone = None  # remove gc cycles
-
     return obj
 
 
 def replacement_traverse(obj, opts, replace):
-    """clone the given expression structure, allowing element
+    """Clone the given expression structure, allowing element
     replacement by a given replacement function.
 
     This function is very similar to the :func:`.visitors.cloned_traverse`
     function, except instead of being passed a dictionary of visitors, all
     elements are unconditionally passed into the given replace function.
     The replace function then has the option to return an entirely new object
-    which will replace the one given.  if it returns ``None``, then the object
+    which will replace the one given.  If it returns ``None``, then the object
     is kept in place.
 
     The difference in usage between :func:`.visitors.cloned_traverse` and
index 6fa93189ccd39fc4a11405248f7f0c6057a9013b..db78ab94b9dba4211d7796edf47ad91bf945ae59 100644 (file)
@@ -373,7 +373,7 @@ class PytestFixtureFunctions(plugin_base.FixtureFunctions):
     }
 
     def combinations(self, *arg_sets, **kw):
-        """facade for pytest.mark.paramtrize.
+        """Facade for pytest.mark.parametrize.
 
         Automatically derives argument names from the callable which in our
         case is always a method on a class with positional arguments.
index 85f7dd85466bc1b8f9ca0a6fe7d3cf1fbe8bca4d..771e931730695af1e190975bcca814d5feba91df 100644 (file)
@@ -38,7 +38,7 @@ _profile_stats = None
 
 
 class ProfileStatsFile(object):
-    """"Store per-platform/fn profiling results in a file.
+    """Store per-platform/fn profiling results in a file.
 
     We're still targeting Py2.5, 2.4 on 0.7 with no dependencies,
     so no json lib :(  need to roll something silly
index 25c43f1730f6ed7c6c18516f5aa4974b0edbc0a4..b022f0357ded9bd6bccc139d6cb113c06737883d 100644 (file)
@@ -107,8 +107,8 @@ class AutomapTest(fixtures.MappedTest):
         """
         The underlying reflect call accepts an optional schema argument.
         This is for determining which database schema to load.
-        This test verifies that prepare can accept an optiona schema argument
-        and pass it to reflect.
+        This test verifies that prepare can accept an optional schema
+        argument and pass it to reflect.
         """
         Base = automap_base(metadata=self.metadata)
         engine_mock = Mock()
index f80b7040cc21515b4dc5385022af917ffaa53223..4aaaf81a03f2a68d841f75cd81c2e9281191a4ff 100644 (file)
@@ -1,6 +1,6 @@
 """Exercises for eager loading.
 
-Derived from mailing list-reported problems and trac tickets.
+Derived from mailing list-reported problems and issue tracker issues.
 
 These are generally very old 0.1-era tests and at some point should
 be cleaned up and modernized.
index 3ca2c1021886d436a0c09098333f6af88cfecfce..aab14f2ed9bcd697b8abc80c81fa52d3d97efffa 100644 (file)
@@ -189,7 +189,6 @@ class BindIntegrationTest(_fixtures.FixtureTest):
             ).engine
             is e2
         )
-
         sess.close()
 
     def test_bind_arg(self):
index c806ec6442049e2a6b7d0dfaa58ac361bf84ff6b..4cc75eca8585dbc626a103d853285d9f6e798be9 100644 (file)
@@ -1006,9 +1006,10 @@ class DeprecatedDeclTest(fixtures.TestBase):
 
 
 class DeprecatedMapperExtensionTest(_fixtures.FixtureTest):
-
     """Superseded by MapperEventsTest - test backwards
-    compatibility of MapperExtension."""
+    compatibility of MapperExtension.
+
+    """
 
     run_inserts = None
 
index 0c60a25e5498a3b05c737325b417d3e70366cd78..c5e9a639ea70add25279bbf2a02e784f83743b6c 100644 (file)
@@ -252,7 +252,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
 
         with expect_warnings(
             "The GenericFunction 'replaceable_func' is already registered and "
-            "is going to be overriden.",
+            "is going to be overridden.",
             regex=False,
         ):