diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-12-08 20:27:16 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-12-27 12:30:38 -0500 |
| commit | 91501e06a17d873902114275d7149ba24973db6a (patch) | |
| tree | 464d2c7167c30d92be13c851b52c0f4471645456 /lib/sqlalchemy/sql | |
| parent | 2bb6cfc7c9b8f09eaa4efeffc337a1162993979c (diff) | |
| download | sqlalchemy-91501e06a17d873902114275d7149ba24973db6a.tar.gz | |
factor out UnboundLoad and rearchitect strategy_options.py
The architecture of Load is mostly rewritten here.
The change includes removal of the "pluggable" aspect
of the loader options, which would patch new methods onto
Load. This has been replaced by normal methods that
respond normally to typing annotations. As part of this
change, the bake_loaders() and unbake_loaders() options,
which have no effect since 1.4 and were unlikely to be
in any common use, have been removed.
Additionally, to support annotations for methods that
make use of @decorator, @generative etc., modified
format_argspec_plus to no longer return "args", instead
returns "grouped_args" which is always grouped and
allows return annotations to format correctly.
Fixes: #6986
Change-Id: I6117c642345cdde65a64389bba6057ddd5374427
Diffstat (limited to 'lib/sqlalchemy/sql')
| -rw-r--r-- | lib/sqlalchemy/sql/base.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py index 4165751ca..65afc57dd 100644 --- a/lib/sqlalchemy/sql/base.py +++ b/lib/sqlalchemy/sql/base.py @@ -109,7 +109,9 @@ def _generative(fn): self = self._generate() x = fn(self, *args, **kw) - assert x is None, "generative methods must have no return value" + assert ( + x is None or x is self + ), "generative methods must return None or self" return self decorated = _generative(fn) @@ -835,7 +837,7 @@ class Executable(roles.StatementRole, Generative): For background on specific kinds of options for specific kinds of statements, refer to the documentation for those option objects. - .. versionchanged:: 1.4 - added :meth:`.Generative.options` to + .. versionchanged:: 1.4 - added :meth:`.Executable.options` to Core statement objects towards the goal of allowing unified Core / ORM querying capabilities. |
