Remove most consistency checks and split builtins.pyi into py2/3 files (#4686)

Split builtins.pyi in Python 2 and 3 versions

Partly addresses #4674
This commit is contained in:
Sebastian Rittau
2020-10-22 22:39:06 +02:00
committed by GitHub
parent b0f4900c9f
commit 5927e5ca30
7 changed files with 3000 additions and 3162 deletions

File diff suppressed because it is too large Load Diff

1205
stdlib/2/builtins.pyi Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1393
stdlib/3/builtins.pyi Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# For various reasons we need the contents of certain files to be
# duplicated in two places, for example stdlib/2and3/builtins.pyi and
# duplicated in two places, for example stdlib/2/builtins.pyi and
# stdlib/2/__builtin__.pyi must be identical. In the past we used
# symlinks but that doesn't always work on Windows, so now you must
# manually update both files, and this test verifies that they are
@@ -11,25 +11,8 @@ import os
import filecmp
consistent_files = [
{'stdlib/2and3/builtins.pyi', 'stdlib/2/__builtin__.pyi'},
{'stdlib/2/SocketServer.pyi', 'stdlib/3/socketserver.pyi'},
{'stdlib/2/os2emxpath.pyi', 'stdlib/2and3/posixpath.pyi',
'stdlib/2and3/ntpath.pyi',
'stdlib/2/os/path.pyi', 'stdlib/3/os/path.pyi'},
{'stdlib/3/enum.pyi', 'third_party/2/enum.pyi'},
{'stdlib/3/unittest/mock.pyi', 'third_party/2and3/mock.pyi'},
{'stdlib/3/concurrent/__init__.pyi', 'third_party/2/concurrent/__init__.pyi'},
{'stdlib/3/concurrent/futures/__init__.pyi', 'third_party/2/concurrent/futures/__init__.pyi'},
{'stdlib/3/concurrent/futures/_base.pyi', 'third_party/2/concurrent/futures/_base.pyi'},
{'stdlib/3/concurrent/futures/thread.pyi', 'third_party/2/concurrent/futures/thread.pyi'},
{'stdlib/3/concurrent/futures/process.pyi', 'third_party/2/concurrent/futures/process.pyi'},
{'stdlib/3.7/dataclasses.pyi', 'third_party/3/dataclasses.pyi'},
{'stdlib/3/pathlib.pyi', 'third_party/2/pathlib2.pyi'},
{'stdlib/3.7/contextvars.pyi', 'third_party/3/contextvars.pyi'},
{'stdlib/3/ipaddress.pyi', 'third_party/2/ipaddress.pyi'},
{'stdlib/2/copy_reg.pyi', 'stdlib/3/copyreg.pyi'},
{'stdlib/2/builtins.pyi', 'stdlib/2/__builtin__.pyi'},
{'stdlib/2and3/threading.pyi', 'stdlib/2and3/_dummy_threading.pyi'},
{'stdlib/3/winreg.pyi', 'stdlib/2/_winreg.pyi'}
]

View File

@@ -3,8 +3,9 @@
# pytype has its own version of these files, and thus doesn't mind if it
# can't parse the typeshed version:
stdlib/2/__builtin__.pyi
stdlib/2/builtins.pyi
stdlib/2/typing.pyi
stdlib/2and3/builtins.pyi
stdlib/3/builtins.pyi
stdlib/3/typing.pyi
# third_party stubs with constructs that pytype doesn't yet support:

View File

@@ -20,6 +20,7 @@ asyncio.tasks.Task._wakeup
asyncio.threads # Added in Python 3.9
asyncio.trsock # Added in Python 3.8
bdb.GENERATOR_AND_COROUTINE_FLAGS
builtins.ModuleNotFoundError
builtins.str.maketrans
cmath.log
codecs.StreamRecoder.seek