mongo-types
mongo-types copied to clipboard
Missing stubs in mongoengine connection
Steps to reproduce:
- Create a module that includes the following code:
import mongoengine
mongoengine.register_connection(
alias="core",
name="foobar",
username="username",
password="password",
)
connection = mongoengine.get_connection("core")
- Run mypy against it:
python -m mypy ./mongo-types-mypy_issue.py
- Observe that mypy does not trigger on
register_connection, but does trigger onget_connection:
[snip ...]/mongo-types-mypy_issue.py:10: error: Module has no attribute "get_connection" [attr-defined]
Found 1 error in 1 file (checked 1 source file)
Expected Behavior: Since __all__ exported by the connection.py module includes get_connection that there would be a stub for it.