Skip to content

Commit abbf34d

Browse files
MartinThomamethane
authored andcommitted
Add NumPyDoc docstring to BaseCursor.execute
* Parameters explained * Return value explained
1 parent 9724752 commit abbf34d

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

pymysql/cursors.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,26 @@ def mogrify(self, query, args=None):
137137
return query
138138

139139
def execute(self, query, args=None):
140-
'''Execute a query'''
140+
"""
141+
Execute a query
142+
143+
Parameters
144+
----------
145+
query : str
146+
Query to execute on the server.
147+
args : tuple, list or dict, optional
148+
Will be used with query
149+
150+
Returns
151+
-------
152+
int
153+
Number of affected rows
154+
155+
Notes
156+
-----
157+
If args is a sequence, %s can be used as a placeholder in the query.
158+
If args is a dict, %(name)s can be used as a placeholder in the query.
159+
"""
141160
while self.nextset():
142161
pass
143162

0 commit comments

Comments
 (0)