Enable stubtest for six (#6699)

This commit is contained in:
Sebastian Rittau
2021-12-27 11:36:17 +01:00
committed by GitHub
parent de8beb1399
commit 51a2cd1289
3 changed files with 31 additions and 4 deletions

View File

@@ -0,0 +1,23 @@
# Problems inherited from the standard library
six.BytesIO.readlines
six.BytesIO.seek
six.StringIO.seek
six.StringIO.truncate
six.moves.*
# Implemented using "operator" functions in the implementation
six.byte2int
six.indexbytes
six.get_function_closure
six.get_function_code
six.get_function_defaults
six.get_function_globals
six.get_method_function
six.get_method_self
six.viewitems
six.viewkeys
six.viewvalues
# Unclear problems
six.Iterator.__init__
six.callable

View File

@@ -1,3 +1,2 @@
version = "1.16.*"
python2 = true
stubtest = false # TODO: figure out why this is needed

View File

@@ -1,10 +1,12 @@
from __future__ import print_function
import builtins
import types
import unittest
from builtins import next as next
from collections.abc import Callable, ItemsView, Iterable, Iterator as _Iterator, KeysView, Mapping, ValuesView
from functools import wraps as wraps
from importlib.util import spec_from_loader as spec_from_loader
from io import BytesIO as BytesIO, StringIO as StringIO
from typing import Any, AnyStr, NoReturn, Pattern, Tuple, Type, TypeVar, overload
from typing_extensions import Literal
@@ -30,9 +32,12 @@ binary_type = bytes
MAXSIZE: int
def callable(obj: object) -> bool: ...
callable = builtins.callable
def get_unbound_function(unbound: types.FunctionType) -> types.FunctionType: ...
def create_bound_method(func: types.FunctionType, obj: object) -> types.MethodType: ...
create_bound_method = types.MethodType
def create_unbound_method(func: types.FunctionType, cls: type) -> types.FunctionType: ...
Iterator = object
@@ -87,7 +92,7 @@ def python_2_unicode_compatible(klass: _T) -> _T: ...
class _LazyDescr:
name: str
def __init__(self, name: str) -> None: ...
def __get__(self, obj: object | None, type: Type[Any] | None = ...) -> Any: ...
def __get__(self, obj: object | None, tp: object) -> Any: ...
class MovedModule(_LazyDescr):
mod: str