File tree Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 1
1
from typing import Any
2
+ from typing import Union
2
3
3
4
from . import base as base
5
+ from .base import Engine
4
6
from .mock import create_mock_engine as create_mock_engine
7
+ from .url import URL
5
8
from .. import event as event
6
9
from .. import exc as exc
7
10
from .. import util as util
8
11
from ..sql import compiler as compiler
9
12
10
- def create_engine (url : Any , ** kwargs : Any ): ...
13
+ def create_engine (url : Union [ str , URL ], ** kwargs : Any ) -> Engine : ...
11
14
def engine_from_config (
12
15
configuration : Any , prefix : str = ..., ** kwargs : Any
13
- ): ...
16
+ ) -> Engine : ...
Original file line number Diff line number Diff line change @@ -59,4 +59,4 @@ class URL:
59
59
def get_dialect (self ): ...
60
60
def translate_connect_args (self , names : Any = ..., ** kw : Any ): ...
61
61
62
- def make_url (name_or_url : Any ) : ...
62
+ def make_url (name_or_url : Union [ str , URL ]) -> URL : ...
Original file line number Diff line number Diff line change 1
1
from typing import Any
2
+ from typing import overload
3
+ from typing import Type
2
4
3
5
from . import exc as exc
4
6
from . import util as util
7
+ from .engine .base import Connection
8
+ from .engine .base import Engine
9
+ from .engine .reflection import Inspector
10
+ from .orm import InstanceState
11
+ from .orm import Mapper
5
12
6
- def inspect (subject : Any , raiseerr : bool = ...): ...
13
+ # this doesn't really seem to work...
14
+ @overload
15
+ def inspect (subject : Any , raiseerr : bool = ...) -> Any : ...
16
+ @overload
17
+ def inspect (subject : Engine , raiseerr : bool = ...) -> Inspector : ...
18
+ @overload
19
+ def inspect (subject : Connection , raiseerr : bool = ...) -> Inspector : ...
20
+ @overload
21
+ def inspect (subject : object , raiseerr : bool = ...) -> InstanceState : ...
22
+ @overload
23
+ def inspect (subject : Type , raiseerr : bool = ...) -> Mapper : ...
You can’t perform that action at this time.
0 commit comments