Skip to content

Add various missing undocumented functions #4554

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

Merged
merged 3 commits into from
Sep 20, 2020
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
7 changes: 6 additions & 1 deletion stdlib/2and3/pickle.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import sys
from typing import IO, Any, Callable, Iterable, Iterator, Mapping, Optional, Tuple, Union
from typing import IO, Any, Callable, Iterable, Iterator, Mapping, Optional, Tuple, Type, Union

HIGHEST_PROTOCOL: int
if sys.version_info >= (3, 0):
DEFAULT_PROTOCOL: int

bytes_types: Tuple[Type[Any], ...] # undocumented

if sys.version_info >= (3, 8):
# TODO: holistic design for buffer interface (typing.Buffer?)
class PickleBuffer:
Expand Down Expand Up @@ -179,3 +181,6 @@ if sys.version_info >= (3, 4):
STACK_GLOBAL: bytes
MEMOIZE: bytes
FRAME: bytes

def encode_long(x: int) -> bytes: ... # undocumented
def decode_long(data: bytes) -> int: ... # undocumented
4 changes: 2 additions & 2 deletions stdlib/2and3/pkgutil.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Stubs for pkgutil

import sys
from _typeshed import SupportsRead
from typing import IO, Any, Callable, Iterable, Iterator, NamedTuple, Optional, Tuple, Union

if sys.version_info >= (3,):
Expand Down Expand Up @@ -32,6 +31,7 @@ def get_importer(path_item: str) -> Optional[PathEntryFinder]: ...
def get_loader(module_or_name: str) -> Loader: ...
def iter_importers(fullname: str = ...) -> Iterator[Union[MetaPathFinder, PathEntryFinder]]: ...
def iter_modules(path: Optional[Iterable[str]] = ..., prefix: str = ...) -> Iterator[_ModuleInfoLike]: ...
def read_code(stream: SupportsRead[bytes]) -> Any: ... # undocumented
def walk_packages(
path: Optional[Iterable[str]] = ..., prefix: str = ..., onerror: Optional[Callable[[str], None]] = ...
) -> Iterator[_ModuleInfoLike]: ...
Expand Down
16 changes: 16 additions & 0 deletions stdlib/2and3/sre_compile.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,25 @@
# and https://github.com/python/cpython/blob/master/Lib/sre_compile.py

import sys
from sre_constants import (
SRE_FLAG_DEBUG as SRE_FLAG_DEBUG,
SRE_FLAG_DOTALL as SRE_FLAG_DOTALL,
SRE_FLAG_IGNORECASE as SRE_FLAG_IGNORECASE,
SRE_FLAG_LOCALE as SRE_FLAG_LOCALE,
SRE_FLAG_MULTILINE as SRE_FLAG_MULTILINE,
SRE_FLAG_TEMPLATE as SRE_FLAG_TEMPLATE,
SRE_FLAG_UNICODE as SRE_FLAG_UNICODE,
SRE_FLAG_VERBOSE as SRE_FLAG_VERBOSE,
SRE_INFO_CHARSET as SRE_INFO_CHARSET,
SRE_INFO_LITERAL as SRE_INFO_LITERAL,
SRE_INFO_PREFIX as SRE_INFO_PREFIX,
)
from sre_parse import SubPattern
from typing import Any, List, Pattern, Tuple, Type, Union

if sys.version_info >= (3,):
from sre_constants import SRE_FLAG_ASCII as SRE_FLAG_ASCII

MAXCODE: int
if sys.version_info < (3, 0):
STRING_TYPES: Tuple[Type[str], Type[unicode]]
Expand Down
2 changes: 0 additions & 2 deletions stdlib/3/_thread.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Stubs for _thread

import sys
from threading import Thread
from types import TracebackType
Expand Down
2 changes: 0 additions & 2 deletions stdlib/3/urllib/request.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Stubs for urllib.request (Python 3.4)

import os
import ssl
import sys
Expand Down