mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
add some more Python 3.7 features (#2014)
This commit is contained in:
committed by
Guido van Rossum
parent
32b4eacea1
commit
ce0656a8c7
@@ -1,7 +1,8 @@
|
||||
# Filip Hron <filip.hron@gmail.com>
|
||||
# based heavily on Andrey Vlasovskikh's python-skeletons https://github.com/JetBrains/python-skeletons/blob/master/sqlite3.py
|
||||
|
||||
from typing import Any, Union, List, Iterator, Optional
|
||||
import sys
|
||||
from typing import Any, Callable, Iterator, List, Optional, Union
|
||||
from datetime import time, datetime
|
||||
from collections import Iterable
|
||||
|
||||
@@ -120,6 +121,10 @@ class Connection(object):
|
||||
# set_progress_handler(handler, n) -> see https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.set_progress_handler
|
||||
def set_progress_handler(self, *args, **kwargs) -> None: ...
|
||||
def set_trace_callback(self, *args, **kwargs): ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def backup(self, target: Connection, *, pages: int = ...,
|
||||
progress: Optional[Callable[[int, int, int], object]] = ..., name: str = ...,
|
||||
sleep: float = ...) -> None: ...
|
||||
def __call__(self, *args, **kwargs): ...
|
||||
def __enter__(self, *args, **kwargs): ...
|
||||
def __exit__(self, *args, **kwargs): ...
|
||||
|
||||
@@ -1,30 +1,19 @@
|
||||
# NOTE: This stub is incomplete - only contains some global functions
|
||||
|
||||
import sys
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
def run(statement: str,
|
||||
globals: Optional[Dict[str, Any]] = ...,
|
||||
locals: Optional[Dict[str, Any]] = ...) -> None:
|
||||
...
|
||||
def run(statement: str, globals: Optional[Dict[str, Any]] = ...,
|
||||
locals: Optional[Dict[str, Any]] = ...) -> None: ...
|
||||
def runeval(expression: str, globals: Optional[Dict[str, Any]] = ...,
|
||||
locals: Optional[Dict[str, Any]] = ...) -> Any: ...
|
||||
def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> None: ...
|
||||
def runcall(*args: Any, **kwds: Any) -> Any: ...
|
||||
|
||||
def runeval(expression: str,
|
||||
globals: Optional[Dict[str, Any]] = ...,
|
||||
locals: Optional[Dict[str, Any]] = ...) -> Any:
|
||||
...
|
||||
if sys.version_info >= (3, 7):
|
||||
def set_trace(*, header: Optional[str] = ...) -> None: ...
|
||||
else:
|
||||
def set_trace() -> None: ...
|
||||
|
||||
def runctx(statement: str,
|
||||
globals: Dict[str, Any],
|
||||
locals: Dict[str, Any]) -> None:
|
||||
...
|
||||
|
||||
def runcall(*args: Any, **kwds: Any) -> Any:
|
||||
...
|
||||
|
||||
def set_trace() -> None:
|
||||
...
|
||||
|
||||
def post_mortem(t: Optional[Any] = ...) -> None:
|
||||
...
|
||||
|
||||
def pm() -> None:
|
||||
...
|
||||
def post_mortem(t: Optional[Any] = ...) -> None: ...
|
||||
def pm() -> None: ...
|
||||
|
||||
@@ -454,7 +454,16 @@ if sys.version_info >= (3, 3):
|
||||
def rmdir(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
else:
|
||||
def rmdir(path: _PathType) -> None: ...
|
||||
if sys.version_info >= (3, 6):
|
||||
if sys.version_info >= (3, 7):
|
||||
class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]):
|
||||
def close(self) -> None: ...
|
||||
@overload
|
||||
def scandir() -> _ScandirIterator[str]: ...
|
||||
@overload
|
||||
def scandir(path: int) -> _ScandirIterator[str]: ...
|
||||
@overload
|
||||
def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ...
|
||||
elif sys.version_info >= (3, 6):
|
||||
class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]):
|
||||
def close(self) -> None: ...
|
||||
@overload
|
||||
@@ -608,3 +617,6 @@ if sys.version_info >= (3, 6):
|
||||
def urandom(size: int) -> bytes: ...
|
||||
else:
|
||||
def urandom(n: int) -> bytes: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def register_at_fork(func: Callable[..., object], when: str) -> None: ...
|
||||
|
||||
@@ -120,6 +120,10 @@ class Connection:
|
||||
# set_progress_handler(handler, n) -> see https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.set_progress_handler
|
||||
def set_progress_handler(self, *args, **kwargs) -> None: ...
|
||||
def set_trace_callback(self, *args, **kwargs): ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def backup(self, target: Connection, *, pages: int = ...,
|
||||
progress: Optional[Callable[[int, int, int], object]] = ..., name: str = ...,
|
||||
sleep: float = ...) -> None: ...
|
||||
def __call__(self, *args, **kwargs): ...
|
||||
def __enter__(self, *args, **kwargs): ...
|
||||
def __exit__(self, *args, **kwargs): ...
|
||||
|
||||
Reference in New Issue
Block a user