Skip to content

Commit

Permalink
MOTOR-1247 - Fix typing issue with motor_asyncio types (#260)
Browse files Browse the repository at this point in the history
* MOTOR-1247 - Typing issue with motor_asyncio types
  • Loading branch information
NoahStapp committed Feb 12, 2024
1 parent 820aa81 commit 928213a
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
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

0 comments on commit 928213a

Please sign in to comment.