You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it is not possible to use aiomysql without lots of # type: ignores or disabling some of the core type-checker rules. For example, pyright in strict mode starts giving errors on the first line of a typical aiomysql usage, because aiomysql.connect() parameters are not type hinted:
Most other APIs aiomysql provides are also not type hinted and therefore fail type-checks too, permanently putting a big "no" on the usage of aiomysql in fully type-checked codebases.
Describe the solution you'd like
I understand proper type hints are pretty hard to make, thus as a first step i see type hinting public functions/classes/etc. without caring about internals much. This will make this library usable with type checkers, while internals can be type hinted gradually.
Describe alternatives you've considered
As was said before, to use aiomysql with type checkers you either need to:
Place # type: ignore at almost every line of code touching aiomysql; or
Disable some of the core checks type checkers offer, invalidating the very point itself of using them in first place.
One can perhaps make type stubs themselves, but nowadays typing support in Python ecosystem is seemed as a must for the majority of projects, or at least lots of developers think so from what i see, and thus i don't think that type stubs should be provided as an external addition.
Additional context
No response
Code of Conduct
I agree to follow the aio-libs Code of Conduct
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
Currently it is not possible to use aiomysql without lots of
# type: ignore
s or disabling some of the core type-checker rules. For example, pyright in strict mode starts giving errors on the first line of a typical aiomysql usage, becauseaiomysql.connect()
parameters are not type hinted:Most other APIs aiomysql provides are also not type hinted and therefore fail type-checks too, permanently putting a big "no" on the usage of aiomysql in fully type-checked codebases.
Describe the solution you'd like
I understand proper type hints are pretty hard to make, thus as a first step i see type hinting public functions/classes/etc. without caring about internals much. This will make this library usable with type checkers, while internals can be type hinted gradually.
Describe alternatives you've considered
As was said before, to use aiomysql with type checkers you either need to:
# type: ignore
at almost every line of code touching aiomysql; orOne can perhaps make type stubs themselves, but nowadays typing support in Python ecosystem is seemed as a must for the majority of projects, or at least lots of developers think so from what i see, and thus i don't think that type stubs should be provided as an external addition.
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: