summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2023-02-16 09:39:07 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2023-02-16 18:01:31 -0500
commit81993801dd39dd4a5973f8500e849f35ac07f2f3 (patch)
tree570a577f1f97e50b0bb195973f4c1ef77f4b12cf /lib/sqlalchemy/sql/selectable.py
parent88c9463dc1114d493ed886a11705af714f27a221 (diff)
downloadsqlalchemy-81993801dd39dd4a5973f8500e849f35ac07f2f3.tar.gz
modernize hybrids and apply typing
Improved the typing support for the :ref:`hybrids_toplevel` extension, updated all documentation to use ORM Annotated Declarative mappings, and added a new modifier called :attr:`.hybrid_property.inplace`. This modifier provides a way to alter the state of a :class:`.hybrid_property` **in place**, which is essentially what very early versions of hybrids did, before SQLAlchemy version 1.2.0 :ticket:`3912` changed this to remove in-place mutation. This in-place mutation is now restored on an **opt-in** basis to allow a single hybrid to have multiple methods set up, without the need to name all the methods the same and without the need to carefully "chain" differently-named methods in order to maintain the composition. Typing tools such as Mypy and Pyright do not allow same-named methods on a class, so with this change a succinct method of setting up hybrids with typing support is restored. Change-Id: Iea88025f023428f9f006846d09fbb4be391f5ebb References: #9321
Diffstat (limited to 'lib/sqlalchemy/sql/selectable.py')
-rw-r--r--lib/sqlalchemy/sql/selectable.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py
index 21b83d556..75b5d09e3 100644
--- a/lib/sqlalchemy/sql/selectable.py
+++ b/lib/sqlalchemy/sql/selectable.py
@@ -3561,7 +3561,7 @@ class SelectBase(
.. seealso::
- :meth:`_expression.SelectBase.as_scalar`.
+ :meth:`_expression.SelectBase.scalar_subquery`.
"""
return self.scalar_subquery().label(name)