Skip to content
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

MOTOR-1247 - Fix typing issue with motor_asyncio types #260

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions motor/motor_asyncio.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import sys

if sys.version_info >= (3, 8):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias

from motor import core, motor_gridfs

__all__: list[str] = [
"AsyncIOMotorClient",
"AsyncIOMotorClientSession",
"AsyncIOMotorDatabase",
"AsyncIOMotorCollection",
"AsyncIOMotorCursor",
"AsyncIOMotorCommandCursor",
"AsyncIOMotorChangeStream",
"AsyncIOMotorGridFSBucket",
"AsyncIOMotorGridIn",
"AsyncIOMotorGridOut",
"AsyncIOMotorGridOutCursor",
"AsyncIOMotorClientEncryption",
]

AsyncIOMotorClient: TypeAlias = core.AgnosticClient

AsyncIOMotorClientSession: TypeAlias = core.AgnosticClientSession

AsyncIOMotorDatabase: TypeAlias = core.AgnosticDatabase

AsyncIOMotorCollection: TypeAlias = core.AgnosticCollection

AsyncIOMotorCursor: TypeAlias = core.AgnosticCursor

AsyncIOMotorCommandCursor: TypeAlias = core.AgnosticCommandCursor

AsyncIOMotorLatentCommandCursor: TypeAlias = core.AgnosticLatentCommandCursor

AsyncIOMotorChangeStream: TypeAlias = core.AgnosticChangeStream

AsyncIOMotorGridFSBucket: TypeAlias = motor_gridfs.AgnosticGridFSBucket

AsyncIOMotorGridIn: TypeAlias = motor_gridfs.AgnosticGridIn

AsyncIOMotorGridOut: TypeAlias = motor_gridfs.AgnosticGridOut

AsyncIOMotorGridOutCursor: TypeAlias = motor_gridfs.AgnosticGridOutCursor

AsyncIOMotorClientEncryption: TypeAlias = core.AgnosticClientEncryption
49 changes: 49 additions & 0 deletions motor/motor_tornado.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import sys

if sys.version_info >= (3, 8):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias

from motor import core, motor_gridfs

__all__: list[str] = [
"MotorClient",
"MotorClientSession",
"MotorDatabase",
"MotorCollection",
"MotorCursor",
"MotorCommandCursor",
"MotorChangeStream",
"MotorGridFSBucket",
"MotorGridIn",
"MotorGridOut",
"MotorGridOutCursor",
"MotorClientEncryption",
]

MotorClient: TypeAlias = core.AgnosticClient

MotorClientSession: TypeAlias = core.AgnosticClientSession

MotorDatabase: TypeAlias = core.AgnosticDatabase

MotorCollection: TypeAlias = core.AgnosticCollection

MotorCursor: TypeAlias = core.AgnosticCursor

MotorCommandCursor: TypeAlias = core.AgnosticCommandCursor

MotorLatentCommandCursor: TypeAlias = core.AgnosticLatentCommandCursor

MotorChangeStream: TypeAlias = core.AgnosticChangeStream

MotorGridFSBucket: TypeAlias = motor_gridfs.AgnosticGridFSBucket

MotorGridIn: TypeAlias = motor_gridfs.AgnosticGridIn

MotorGridOut: TypeAlias = motor_gridfs.AgnosticGridOut

MotorGridOutCursor: TypeAlias = motor_gridfs.AgnosticGridOutCursor

MotorClientEncryption: TypeAlias = core.AgnosticClientEncryption