-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] 🏷️ Add type hints #911
Conversation
self._conn = None | ||
|
||
|
||
class _PoolConnectionContextManager: |
Check failure
Code scanning / CodeQL
`__iter__` method returns a non-iterator
def setoutputsizes(self, *args): | ||
"""Does nothing, required by DB API.""" | ||
|
||
async def nextset(self): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns
logger.info("%r", args) | ||
return self._rowcount | ||
|
||
async def executemany(self, query, args): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns
row = self._conv_row(row) | ||
return row | ||
|
||
async def fetchone(self): |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns
What do these changes do?
This pull request adds type hints to aiomysql, making it easier for developers to understand the API and to use the library in their code. Due to cyclic dependencies between the cursor and connection classes, two files have been merged into one. Additionally, the _ContextManager class has been generalized as much as possible to improve code reuse and maintainability.
Related issue number
#707
Checklist
CHANGES
folder