]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
use sequence instead of list in result docs
authorFederico Caselli <cfederico87@gmail.com>
Sat, 20 Jan 2024 17:33:28 +0000 (18:33 +0100)
committerFederico Caselli <cfederico87@gmail.com>
Sat, 20 Jan 2024 17:33:28 +0000 (18:33 +0100)
Change-Id: Iaed8505c495455f0d82e4b0cbcc7dffd2d833408

lib/sqlalchemy/engine/result.py

index c9d51e06677f812d220d7d5e409754ea43237867..f1c18cf456fdfb5bde33e2167004aa8609a9a3b5 100644 (file)
@@ -1349,7 +1349,7 @@ class Result(_WithKeys, ResultInternal[Row[_TP]]):
     def fetchmany(self, size: Optional[int] = None) -> Sequence[Row[_TP]]:
         """Fetch many rows.
 
-        When all rows are exhausted, returns an empty list.
+        When all rows are exhausted, returns an empty sequence.
 
         This method is provided for backwards compatibility with
         SQLAlchemy 1.x.x.
@@ -1357,7 +1357,7 @@ class Result(_WithKeys, ResultInternal[Row[_TP]]):
         To fetch rows in groups, use the :meth:`_engine.Result.partitions`
         method.
 
-        :return: a list of :class:`_engine.Row` objects.
+        :return: a sequence of :class:`_engine.Row` objects.
 
         .. seealso::
 
@@ -1368,14 +1368,14 @@ class Result(_WithKeys, ResultInternal[Row[_TP]]):
         return self._manyrow_getter(self, size)
 
     def all(self) -> Sequence[Row[_TP]]:
-        """Return all rows in a list.
+        """Return all rows in a sequence.
 
         Closes the result set after invocation.   Subsequent invocations
-        will return an empty list.
+        will return an empty sequence.
 
         .. versionadded:: 1.4
 
-        :return: a list of :class:`_engine.Row` objects.
+        :return: a sequence of :class:`_engine.Row` objects.
 
         .. seealso::
 
@@ -1773,7 +1773,7 @@ class ScalarResult(FilterResult[_R]):
         return self._manyrow_getter(self, size)
 
     def all(self) -> Sequence[_R]:
-        """Return all scalar values in a list.
+        """Return all scalar values in a sequence.
 
         Equivalent to :meth:`_engine.Result.all` except that
         scalar values, rather than :class:`_engine.Row` objects,
@@ -1877,7 +1877,7 @@ class TupleResult(FilterResult[_R], util.TypingOnly):
             ...
 
         def all(self) -> Sequence[_R]:  # noqa: A001
-            """Return all scalar values in a list.
+            """Return all scalar values in a sequence.
 
             Equivalent to :meth:`_engine.Result.all` except that
             tuple values, rather than :class:`_engine.Row` objects,
@@ -2083,7 +2083,7 @@ class MappingResult(_WithKeys, FilterResult[RowMapping]):
         return self._manyrow_getter(self, size)
 
     def all(self) -> Sequence[RowMapping]:
-        """Return all scalar values in a list.
+        """Return all scalar values in a sequence.
 
         Equivalent to :meth:`_engine.Result.all` except that
         :class:`_engine.RowMapping` values, rather than :class:`_engine.Row`