Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Add incomplete mapping to Tornado stubs instead of empty file #9

@alexmaurizio

Description

@alexmaurizio

Hello,
due to the actual tornado stub being empty, the reference file when using elements like MotorClient and MotorDatabase is to default to not resolving the import.
image

MyPy will complain, as the language server.

Substituting it with a basic stub does not enforce correct typing, but does not block the issue
This is generated via stubgen, of course this is not a real stub but at least solves the issue temporarily, until a full stub is implemented

image

Incomplete is better than an empty file, but might hide the fact that this is not implemented, I'm not sure if this was a deliberate implementation decision.

motor_tornado.pyi

from _typeshed import Incomplete
from typing import TypeVar

T = TypeVar('T')
MotorClient: Incomplete
MotorDatabase: Incomplete
MotorCollection: Incomplete
MotorCursor: Incomplete
MotorCommandCursor: Incomplete
MotorChangeStream: Incomplete
MotorGridFSBucket: Incomplete
MotorGridIn: Incomplete
MotorGridOut: Incomplete
MotorGridOutCursor: Incomplete
MotorClientEncryption: Incomplete

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions