Stubtest exceptions for sys, symtable, sysconfig and tarfile (#5138)

This commit is contained in:
hatal175
2021-03-27 07:33:19 +03:00
committed by GitHub
parent 839d711c6f
commit 20a6de8fdd
5 changed files with 17 additions and 12 deletions

View File

@@ -1,9 +1,10 @@
import sys
from typing import List, Sequence, Text, Tuple
from typing import Any, List, Optional, Sequence, Text, Tuple
def symtable(code: Text, filename: Text, compile_type: Text) -> SymbolTable: ...
class SymbolTable(object):
def __init__(self, raw_table: Any, filename: str) -> None: ...
def get_type(self) -> str: ...
def get_id(self) -> int: ...
def get_name(self) -> str: ...
@@ -29,6 +30,12 @@ class Class(SymbolTable):
def get_methods(self) -> Tuple[str, ...]: ...
class Symbol(object):
if sys.version_info >= (3, 8):
def __init__(
self, name: str, flags: int, namespaces: Optional[Sequence[SymbolTable]] = ..., *, module_scope: bool = ...
) -> None: ...
else:
def __init__(self, name: str, flags: int, namespaces: Optional[Sequence[SymbolTable]] = ...) -> None: ...
def get_name(self) -> str: ...
def is_referenced(self) -> bool: ...
def is_parameter(self) -> bool: ...

View File

@@ -11,7 +11,7 @@ def get_path(name: str, scheme: str = ..., vars: Optional[Dict[str, Any]] = ...,
def get_paths(scheme: str = ..., vars: Optional[Dict[str, Any]] = ..., expand: bool = ...) -> Dict[str, str]: ...
def get_python_version() -> str: ...
def get_platform() -> str: ...
def is_python_build() -> bool: ...
def parse_config_h(fp: IO[Any], vars: Optional[Dict[str, Any]]) -> Dict[str, Any]: ...
def is_python_build(check_home: bool = ...) -> bool: ...
def parse_config_h(fp: IO[Any], vars: Optional[Dict[str, Any]] = ...) -> Dict[str, Any]: ...
def get_config_h_filename() -> str: ...
def get_makefile_filename() -> str: ...

View File

@@ -77,7 +77,7 @@ smtplib.SMTP.sendmail
sre_constants.RANGE_IGNORE
ssl.PROTOCOL_SSLv3
ssl.RAND_egd
sys.UnraisableHookArgs
sys.UnraisableHookArgs # Not exported from sys
types.ClassMethodDescriptorType.__get__
types.CodeType.replace
types.MethodDescriptorType.__get__

View File

@@ -102,7 +102,7 @@ ssl.AF_INET
ssl.PROTOCOL_SSLv3
ssl.RAND_egd
symtable.SymbolTable.has_exec
sys.UnraisableHookArgs
sys.UnraisableHookArgs # Not exported from sys
time.CLOCK_PROF
time.CLOCK_UPTIME
types.ClassMethodDescriptorType.__get__

View File

@@ -362,13 +362,11 @@ sunau.Au_write.getmark
sunau.Au_write.getmarkers
sunau.Au_write.setcomptype
sunau.Au_write.setmark
symtable.Symbol.__init__
symtable.SymbolTable.__init__
sys.gettotalrefcount
sys.implementation
sysconfig.is_python_build
sysconfig.parse_config_h
tarfile.TarFile.errors
sys.gettotalrefcount # Available on python debug builds
sys.implementation # Actually SimpleNamespace but then you wouldn't have convenient attributes
tarfile.TarFile.errors # errors is initialized for some reason as None even though it really only accepts str
# SpooledTemporaryFile implements IO except these methods
# See also https://github.com/python/typeshed/pull/2452#issuecomment-420657918
tempfile.SpooledTemporaryFile.__next__
tempfile.SpooledTemporaryFile.readable
tempfile.SpooledTemporaryFile.seekable