Skip to content

Commit 7088e97

Browse files
committed
Rename CursorInterface -> CursorFactory
1 parent cfb1c80 commit 7088e97

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

asyncpg/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ async def _get_statement(self, query, timeout):
121121
return state
122122

123123
def cursor(self, query, *args, prefetch=None, timeout=None):
124-
return cursor.CursorInterface(self, query, None, args,
125-
prefetch, timeout)
124+
return cursor.CursorFactory(self, query, None, args,
125+
prefetch, timeout)
126126

127127
async def prepare(self, query, *, timeout=None):
128128
"""Create a *prepared statement* for the specified query.

asyncpg/cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from . import exceptions
1212

1313

14-
class CursorInterface:
14+
class CursorFactory:
1515
"""A cursor interface for the results of a query.
1616
1717
A cursor interface can be used to initiate efficient traversal of the

asyncpg/prepared_stmt.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@ def get_attributes(self):
4242
return self._state._get_attributes()
4343

4444
def cursor(self, *args, prefetch=None,
45-
timeout=None) -> cursor.CursorInterface:
45+
timeout=None) -> cursor.CursorFactory:
4646
"""Return a *cursor interface* for the prepared statement.
4747
4848
:param args: Query arguments.
4949
:param int prefetch: The number of rows the *cursor iterator*
5050
will prefetch (defaults to ``50``.)
5151
:param float timeout: Optional timeout in seconds.
5252
53-
:return: A :class:`~cursor.CursorInterface` object.
53+
:return: A :class:`~cursor.CursorFactory` object.
5454
"""
5555
self.__check_open()
56-
return cursor.CursorInterface(self._connection, self._query,
57-
self._state, args, prefetch,
58-
timeout)
56+
return cursor.CursorFactory(self._connection, self._query,
57+
self._state, args, prefetch,
58+
timeout)
5959

6060
async def explain(self, *args, analyze=False):
6161
"""Return the execution plan of the statement.

docs/api/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ result set.
155155
``DECLARE ... CURSOR WITH HOLD`` SQL statement directly.
156156

157157

158-
.. autoclass:: asyncpg.cursor.CursorInterface()
158+
.. autoclass:: asyncpg.cursor.CursorFactory()
159159
:members:
160160

161161
.. describe:: async for row in c

0 commit comments

Comments
 (0)