Skip to content

Commit 59a3da4

Browse files
committed
Shorten long lines
1 parent 23c1c39 commit 59a3da4

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

asyncpg/connection.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,12 @@ def is_in_transaction(self):
311311
"""
312312
return self._protocol.is_in_transaction()
313313

314-
async def execute(self, query: str, *args, timeout: typing.Optional[float]=None) -> str:
314+
async def execute(
315+
self,
316+
query: str,
317+
*args,
318+
timeout: typing.Optional[float]=None,
319+
) -> str:
315320
"""Execute an SQL command (or commands).
316321
317322
This method can execute many SQL commands at once, when no arguments
@@ -358,7 +363,13 @@ async def execute(self, query: str, *args, timeout: typing.Optional[float]=None)
358363
)
359364
return status.decode()
360365

361-
async def executemany(self, command: str, args, *, timeout: typing.Optional[float]=None):
366+
async def executemany(
367+
self,
368+
command: str,
369+
args,
370+
*,
371+
timeout: typing.Optional[float]=None,
372+
):
362373
"""Execute an SQL *command* for each sequence of arguments in *args*.
363374
364375
Example:
@@ -757,7 +768,12 @@ async def fetchrow(
757768
return data[0]
758769

759770
async def fetchmany(
760-
self, query, args, *, timeout: typing.Optional[float]=None, record_class=None
771+
self,
772+
query,
773+
args,
774+
*,
775+
timeout: typing.Optional[float]=None,
776+
record_class=None,
761777
):
762778
"""Run a query for each sequence of arguments in *args*
763779
and return the results as a list of :class:`Record`.

asyncpg/pool.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,12 @@ async def _get_new_connection(self):
574574

575575
return con
576576

577-
async def execute(self, query: str, *args, timeout: Optional[float]=None) -> str:
577+
async def execute(
578+
self,
579+
query: str,
580+
*args,
581+
timeout: Optional[float]=None,
582+
) -> str:
578583
"""Execute an SQL command (or commands).
579584
580585
Pool performs this operation using one of its connections. Other than
@@ -586,7 +591,13 @@ async def execute(self, query: str, *args, timeout: Optional[float]=None) -> str
586591
async with self.acquire() as con:
587592
return await con.execute(query, *args, timeout=timeout)
588593

589-
async def executemany(self, command: str, args, *, timeout: Optional[float]=None):
594+
async def executemany(
595+
self,
596+
command: str,
597+
args,
598+
*,
599+
timeout: Optional[float]=None,
600+
):
590601
"""Execute an SQL *command* for each sequence of arguments in *args*.
591602
592603
Pool performs this operation using one of its connections. Other than

0 commit comments

Comments
 (0)