summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/decl_api.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2023-01-20 13:34:07 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2023-01-20 13:34:07 -0500
commit2f91dd79310657814ad28b6ef64f91fff7a007c9 (patch)
tree924c4118abc52316dc53d28917c3bbc21b926d8b /lib/sqlalchemy/orm/decl_api.py
parent0a22ae63605f057866a998172d838634eea3b126 (diff)
downloadsqlalchemy-2f91dd79310657814ad28b6ef64f91fff7a007c9.tar.gz
clarify __table__, local_table
These are typed as FromClause, make sure this is stated up front indicating Table as a subset of possible object types. Change-Id: I15961a69d3655600249e3cfe6c4b3372f97d4485 References: #9130
Diffstat (limited to 'lib/sqlalchemy/orm/decl_api.py')
-rw-r--r--lib/sqlalchemy/orm/decl_api.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/decl_api.py b/lib/sqlalchemy/orm/decl_api.py
index 844628443..ecd81c7ed 100644
--- a/lib/sqlalchemy/orm/decl_api.py
+++ b/lib/sqlalchemy/orm/decl_api.py
@@ -709,9 +709,13 @@ class DeclarativeBase(
"""
__table__: ClassVar[FromClause]
- """The :class:`_schema.Table` to which a particular subclass is
+ """The :class:`_sql.FromClause` to which a particular subclass is
mapped.
+ This is usually an instance of :class:`_schema.Table` but may also
+ refer to other kinds of :class:`_sql.FromClause` such as
+ :class:`_sql.Subquery`, depending on how the class is mapped.
+
.. seealso::
:ref:`orm_declarative_metadata`
@@ -818,9 +822,13 @@ class DeclarativeBaseNoMeta(inspection.Inspectable[Mapper[Any]]):
"""
__table__: Optional[FromClause]
- """The :class:`_schema.Table` to which a particular subclass is
+ """The :class:`_sql.FromClause` to which a particular subclass is
mapped.
+ This is usually an instance of :class:`_schema.Table` but may also
+ refer to other kinds of :class:`_sql.FromClause` such as
+ :class:`_sql.Subquery`, depending on how the class is mapped.
+
.. seealso::
:ref:`orm_declarative_metadata`