├── .github ├── ISSUE_TEMPLATE │ ├── bug.md │ ├── crash.md │ ├── documentation.md │ ├── feature.md │ └── question.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── mypy_primer.yml │ ├── mypy_primer_comment.yml │ ├── test.yml │ └── test_stubgenc.yml ├── .gitignore ├── .gitmodules ├── .travis.yml ├── CONTRIBUTING.md ├── CREDITS ├── LICENSE ├── MANIFEST.in ├── README.md ├── ROADMAP.md ├── build-requirements.txt ├── conftest.py ├── docs ├── Makefile ├── README.md ├── make.bat ├── requirements-docs.txt └── source │ ├── additional_features.rst │ ├── builtin_types.rst │ ├── casts.rst │ ├── cheat_sheet.rst │ ├── cheat_sheet_py3.rst │ ├── class_basics.rst │ ├── command_line.rst │ ├── common_issues.rst │ ├── conf.py │ ├── config_file.rst │ ├── duck_type_compatibility.rst │ ├── dynamic_typing.rst │ ├── error_code_list.rst │ ├── error_code_list2.rst │ ├── error_codes.rst │ ├── existing_code.rst │ ├── extending_mypy.rst │ ├── faq.rst │ ├── final_attrs.rst │ ├── generics.rst │ ├── getting_started.rst │ ├── index.rst │ ├── inline_config.rst │ ├── installed_packages.rst │ ├── introduction.rst │ ├── kinds_of_types.rst │ ├── literal_types.rst │ ├── metaclasses.rst │ ├── more_types.rst │ ├── mypy_daemon.rst │ ├── protocols.rst │ ├── python2.rst │ ├── running_mypy.rst │ ├── runtime_troubles.rst │ ├── stubgen.rst │ ├── stubs.rst │ ├── supported_python_features.rst │ └── type_inference_and_annotations.rst ├── misc ├── actions_stubs.py ├── analyze_cache.py ├── apply-cache-diff.py ├── async_matrix.py ├── build-debug-python.sh ├── build_wheel.py ├── clean-mypyc.sh ├── convert-cache.py ├── diff-cache.py ├── dump-ast.py ├── fix_annotate.py ├── incremental_checker.py ├── macs.el ├── perf_checker.py ├── proper_plugin.py ├── remove-eol-whitespace.sh ├── sync-typeshed.py ├── test-stubgenc.sh ├── test_case_to_actual.py ├── touch_checker.py ├── trigger_wheel_build.sh ├── upload-pypi.py └── variadics.py ├── mypy-requirements.txt ├── mypy ├── __init__.py ├── __main__.py ├── api.py ├── applytype.py ├── argmap.py ├── binder.py ├── bogus_type.py ├── build.py ├── checker.py ├── checkexpr.py ├── checkmember.py ├── checkstrformat.py ├── config_parser.py ├── constraints.py ├── defaults.py ├── dmypy │ ├── __init__.py │ ├── __main__.py │ └── client.py ├── dmypy_os.py ├── dmypy_server.py ├── dmypy_util.py ├── erasetype.py ├── errorcodes.py ├── errors.py ├── expandtype.py ├── exprtotype.py ├── fastparse.py ├── fastparse2.py ├── find_sources.py ├── fixup.py ├── freetree.py ├── fscache.py ├── fswatcher.py ├── gclogger.py ├── git.py ├── indirection.py ├── infer.py ├── ipc.py ├── join.py ├── literals.py ├── lookup.py ├── main.py ├── maptype.py ├── meet.py ├── memprofile.py ├── message_registry.py ├── messages.py ├── metastore.py ├── mixedtraverser.py ├── modulefinder.py ├── moduleinspect.py ├── mro.py ├── nodes.py ├── options.py ├── ordered_dict.py ├── parse.py ├── plugin.py ├── plugins │ ├── __init__.py │ ├── attrs.py │ ├── common.py │ ├── ctypes.py │ ├── dataclasses.py │ ├── default.py │ └── enums.py ├── py.typed ├── reachability.py ├── renaming.py ├── report.py ├── sametypes.py ├── scope.py ├── semanal.py ├── semanal_classprop.py ├── semanal_enum.py ├── semanal_infer.py ├── semanal_main.py ├── semanal_namedtuple.py ├── semanal_newtype.py ├── semanal_pass1.py ├── semanal_shared.py ├── semanal_typeargs.py ├── semanal_typeddict.py ├── server │ ├── __init__.py │ ├── astdiff.py │ ├── astmerge.py │ ├── aststrip.py │ ├── deps.py │ ├── mergecheck.py │ ├── objgraph.py │ ├── subexpr.py │ ├── target.py │ ├── trigger.py │ └── update.py ├── sharedparse.py ├── sitepkgs.py ├── solve.py ├── split_namespace.py ├── state.py ├── stats.py ├── strconv.py ├── stubdoc.py ├── stubgen.py ├── stubgenc.py ├── stubinfo.py ├── stubtest.py ├── stubutil.py ├── subtypes.py ├── suggestions.py ├── test │ ├── __init__.py │ ├── collect.py │ ├── config.py │ ├── data.py │ ├── helpers.py │ ├── test_find_sources.py │ ├── testapi.py │ ├── testargs.py │ ├── testcheck.py │ ├── testcmdline.py │ ├── testdaemon.py │ ├── testdeps.py │ ├── testdiff.py │ ├── testerrorstream.py │ ├── testfinegrained.py │ ├── testfinegrainedcache.py │ ├── testformatter.py │ ├── testfscache.py │ ├── testgraph.py │ ├── testinfer.py │ ├── testipc.py │ ├── testmerge.py │ ├── testmodulefinder.py │ ├── testmypyc.py │ ├── testparse.py │ ├── testpep561.py │ ├── testpythoneval.py │ ├── testreports.py │ ├── testsamples.py │ ├── testsemanal.py │ ├── testsolve.py │ ├── teststubgen.py │ ├── teststubtest.py │ ├── testsubtypes.py │ ├── testtransform.py │ ├── testtypegen.py │ ├── testtypes.py │ ├── testutil.py │ ├── typefixture.py │ ├── update.py │ └── visitors.py ├── traverser.py ├── treetransform.py ├── tvar_scope.py ├── type_visitor.py ├── typeanal.py ├── typeops.py ├── types.py ├── typeshed │ └── stdlib │ │ ├── @python2 │ │ ├── BaseHTTPServer.pyi │ │ ├── CGIHTTPServer.pyi │ │ ├── ConfigParser.pyi │ │ ├── Cookie.pyi │ │ ├── HTMLParser.pyi │ │ ├── Queue.pyi │ │ ├── SimpleHTTPServer.pyi │ │ ├── SocketServer.pyi │ │ ├── StringIO.pyi │ │ ├── UserDict.pyi │ │ ├── UserList.pyi │ │ ├── UserString.pyi │ │ ├── __builtin__.pyi │ │ ├── _ast.pyi │ │ ├── _collections.pyi │ │ ├── _functools.pyi │ │ ├── _hotshot.pyi │ │ ├── _io.pyi │ │ ├── _json.pyi │ │ ├── _md5.pyi │ │ ├── _sha.pyi │ │ ├── _sha256.pyi │ │ ├── _sha512.pyi │ │ ├── _socket.pyi │ │ ├── _sre.pyi │ │ ├── _struct.pyi │ │ ├── _symtable.pyi │ │ ├── _threading_local.pyi │ │ ├── _winreg.pyi │ │ ├── abc.pyi │ │ ├── ast.pyi │ │ ├── atexit.pyi │ │ ├── builtins.pyi │ │ ├── cPickle.pyi │ │ ├── cStringIO.pyi │ │ ├── collections.pyi │ │ ├── commands.pyi │ │ ├── compileall.pyi │ │ ├── cookielib.pyi │ │ ├── copy_reg.pyi │ │ ├── dircache.pyi │ │ ├── distutils │ │ │ ├── __init__.pyi │ │ │ ├── archive_util.pyi │ │ │ ├── bcppcompiler.pyi │ │ │ ├── ccompiler.pyi │ │ │ ├── cmd.pyi │ │ │ ├── command │ │ │ │ ├── __init__.pyi │ │ │ │ ├── bdist.pyi │ │ │ │ ├── bdist_dumb.pyi │ │ │ │ ├── bdist_msi.pyi │ │ │ │ ├── bdist_packager.pyi │ │ │ │ ├── bdist_rpm.pyi │ │ │ │ ├── bdist_wininst.pyi │ │ │ │ ├── build.pyi │ │ │ │ ├── build_clib.pyi │ │ │ │ ├── build_ext.pyi │ │ │ │ ├── build_py.pyi │ │ │ │ ├── build_scripts.pyi │ │ │ │ ├── check.pyi │ │ │ │ ├── clean.pyi │ │ │ │ ├── config.pyi │ │ │ │ ├── install.pyi │ │ │ │ ├── install_data.pyi │ │ │ │ ├── install_egg_info.pyi │ │ │ │ ├── install_headers.pyi │ │ │ │ ├── install_lib.pyi │ │ │ │ ├── install_scripts.pyi │ │ │ │ ├── register.pyi │ │ │ │ ├── sdist.pyi │ │ │ │ └── upload.pyi │ │ │ ├── config.pyi │ │ │ ├── core.pyi │ │ │ ├── cygwinccompiler.pyi │ │ │ ├── debug.pyi │ │ │ ├── dep_util.pyi │ │ │ ├── dir_util.pyi │ │ │ ├── dist.pyi │ │ │ ├── emxccompiler.pyi │ │ │ ├── errors.pyi │ │ │ ├── extension.pyi │ │ │ ├── fancy_getopt.pyi │ │ │ ├── file_util.pyi │ │ │ ├── filelist.pyi │ │ │ ├── log.pyi │ │ │ ├── msvccompiler.pyi │ │ │ ├── spawn.pyi │ │ │ ├── sysconfig.pyi │ │ │ ├── text_file.pyi │ │ │ ├── unixccompiler.pyi │ │ │ ├── util.pyi │ │ │ └── version.pyi │ │ ├── dummy_thread.pyi │ │ ├── email │ │ │ ├── MIMEText.pyi │ │ │ ├── __init__.pyi │ │ │ ├── _parseaddr.pyi │ │ │ ├── base64mime.pyi │ │ │ ├── charset.pyi │ │ │ ├── encoders.pyi │ │ │ ├── feedparser.pyi │ │ │ ├── generator.pyi │ │ │ ├── header.pyi │ │ │ ├── iterators.pyi │ │ │ ├── message.pyi │ │ │ ├── mime │ │ │ │ ├── __init__.pyi │ │ │ │ ├── application.pyi │ │ │ │ ├── audio.pyi │ │ │ │ ├── base.pyi │ │ │ │ ├── image.pyi │ │ │ │ ├── message.pyi │ │ │ │ ├── multipart.pyi │ │ │ │ ├── nonmultipart.pyi │ │ │ │ └── text.pyi │ │ │ ├── parser.pyi │ │ │ ├── quoprimime.pyi │ │ │ └── utils.pyi │ │ ├── encodings │ │ │ ├── __init__.pyi │ │ │ └── utf_8.pyi │ │ ├── exceptions.pyi │ │ ├── fcntl.pyi │ │ ├── fnmatch.pyi │ │ ├── functools.pyi │ │ ├── future_builtins.pyi │ │ ├── gc.pyi │ │ ├── getopt.pyi │ │ ├── getpass.pyi │ │ ├── gettext.pyi │ │ ├── glob.pyi │ │ ├── gzip.pyi │ │ ├── hashlib.pyi │ │ ├── heapq.pyi │ │ ├── htmlentitydefs.pyi │ │ ├── httplib.pyi │ │ ├── imp.pyi │ │ ├── importlib.pyi │ │ ├── inspect.pyi │ │ ├── io.pyi │ │ ├── itertools.pyi │ │ ├── json.pyi │ │ ├── markupbase.pyi │ │ ├── md5.pyi │ │ ├── mimetools.pyi │ │ ├── multiprocessing │ │ │ ├── __init__.pyi │ │ │ ├── dummy │ │ │ │ ├── __init__.pyi │ │ │ │ └── connection.pyi │ │ │ ├── pool.pyi │ │ │ ├── process.pyi │ │ │ └── util.pyi │ │ ├── mutex.pyi │ │ ├── ntpath.pyi │ │ ├── nturl2path.pyi │ │ ├── os │ │ │ ├── __init__.pyi │ │ │ └── path.pyi │ │ ├── os2emxpath.pyi │ │ ├── pipes.pyi │ │ ├── platform.pyi │ │ ├── popen2.pyi │ │ ├── posix.pyi │ │ ├── posixpath.pyi │ │ ├── random.pyi │ │ ├── re.pyi │ │ ├── repr.pyi │ │ ├── resource.pyi │ │ ├── rfc822.pyi │ │ ├── robotparser.pyi │ │ ├── runpy.pyi │ │ ├── sets.pyi │ │ ├── sha.pyi │ │ ├── shelve.pyi │ │ ├── shlex.pyi │ │ ├── signal.pyi │ │ ├── smtplib.pyi │ │ ├── spwd.pyi │ │ ├── sre_constants.pyi │ │ ├── sre_parse.pyi │ │ ├── stat.pyi │ │ ├── string.pyi │ │ ├── stringold.pyi │ │ ├── strop.pyi │ │ ├── subprocess.pyi │ │ ├── symbol.pyi │ │ ├── sys.pyi │ │ ├── tempfile.pyi │ │ ├── textwrap.pyi │ │ ├── thread.pyi │ │ ├── toaiff.pyi │ │ ├── tokenize.pyi │ │ ├── types.pyi │ │ ├── typing.pyi │ │ ├── unittest.pyi │ │ ├── urllib.pyi │ │ ├── urllib2.pyi │ │ ├── urlparse.pyi │ │ ├── user.pyi │ │ ├── whichdb.pyi │ │ └── xmlrpclib.pyi │ │ ├── VERSIONS │ │ ├── __future__.pyi │ │ ├── _ast.pyi │ │ ├── _bisect.pyi │ │ ├── _bootlocale.pyi │ │ ├── _codecs.pyi │ │ ├── _compat_pickle.pyi │ │ ├── _compression.pyi │ │ ├── _csv.pyi │ │ ├── _curses.pyi │ │ ├── _decimal.pyi │ │ ├── _dummy_thread.pyi │ │ ├── _dummy_threading.pyi │ │ ├── _heapq.pyi │ │ ├── _imp.pyi │ │ ├── _importlib_modulespec.pyi │ │ ├── _json.pyi │ │ ├── _markupbase.pyi │ │ ├── _msi.pyi │ │ ├── _operator.pyi │ │ ├── _osx_support.pyi │ │ ├── _posixsubprocess.pyi │ │ ├── _py_abc.pyi │ │ ├── _pydecimal.pyi │ │ ├── _random.pyi │ │ ├── _sitebuiltins.pyi │ │ ├── _stat.pyi │ │ ├── _thread.pyi │ │ ├── _threading_local.pyi │ │ ├── _tkinter.pyi │ │ ├── _tracemalloc.pyi │ │ ├── _typeshed │ │ ├── __init__.pyi │ │ ├── wsgi.pyi │ │ └── xml.pyi │ │ ├── _warnings.pyi │ │ ├── _weakref.pyi │ │ ├── _weakrefset.pyi │ │ ├── _winapi.pyi │ │ ├── abc.pyi │ │ ├── aifc.pyi │ │ ├── antigravity.pyi │ │ ├── argparse.pyi │ │ ├── array.pyi │ │ ├── ast.pyi │ │ ├── asynchat.pyi │ │ ├── asyncio │ │ ├── __init__.pyi │ │ ├── base_events.pyi │ │ ├── base_futures.pyi │ │ ├── base_subprocess.pyi │ │ ├── base_tasks.pyi │ │ ├── compat.pyi │ │ ├── constants.pyi │ │ ├── coroutines.pyi │ │ ├── events.pyi │ │ ├── exceptions.pyi │ │ ├── format_helpers.pyi │ │ ├── futures.pyi │ │ ├── locks.pyi │ │ ├── log.pyi │ │ ├── proactor_events.pyi │ │ ├── protocols.pyi │ │ ├── queues.pyi │ │ ├── runners.pyi │ │ ├── selector_events.pyi │ │ ├── sslproto.pyi │ │ ├── staggered.pyi │ │ ├── streams.pyi │ │ ├── subprocess.pyi │ │ ├── tasks.pyi │ │ ├── threads.pyi │ │ ├── transports.pyi │ │ ├── trsock.pyi │ │ ├── unix_events.pyi │ │ ├── windows_events.pyi │ │ └── windows_utils.pyi │ │ ├── asyncore.pyi │ │ ├── atexit.pyi │ │ ├── audioop.pyi │ │ ├── base64.pyi │ │ ├── bdb.pyi │ │ ├── binascii.pyi │ │ ├── binhex.pyi │ │ ├── bisect.pyi │ │ ├── builtins.pyi │ │ ├── bz2.pyi │ │ ├── cProfile.pyi │ │ ├── calendar.pyi │ │ ├── cgi.pyi │ │ ├── cgitb.pyi │ │ ├── chunk.pyi │ │ ├── cmath.pyi │ │ ├── cmd.pyi │ │ ├── code.pyi │ │ ├── codecs.pyi │ │ ├── codeop.pyi │ │ ├── collections │ │ ├── __init__.pyi │ │ └── abc.pyi │ │ ├── colorsys.pyi │ │ ├── compileall.pyi │ │ ├── concurrent │ │ ├── __init__.pyi │ │ └── futures │ │ │ ├── __init__.pyi │ │ │ ├── _base.pyi │ │ │ ├── process.pyi │ │ │ └── thread.pyi │ │ ├── configparser.pyi │ │ ├── contextlib.pyi │ │ ├── contextvars.pyi │ │ ├── copy.pyi │ │ ├── copyreg.pyi │ │ ├── crypt.pyi │ │ ├── csv.pyi │ │ ├── ctypes │ │ ├── __init__.pyi │ │ ├── util.pyi │ │ └── wintypes.pyi │ │ ├── curses │ │ ├── __init__.pyi │ │ ├── ascii.pyi │ │ ├── panel.pyi │ │ └── textpad.pyi │ │ ├── dataclasses.pyi │ │ ├── datetime.pyi │ │ ├── dbm │ │ ├── __init__.pyi │ │ ├── dumb.pyi │ │ ├── gnu.pyi │ │ └── ndbm.pyi │ │ ├── decimal.pyi │ │ ├── difflib.pyi │ │ ├── dis.pyi │ │ ├── distutils │ │ ├── __init__.pyi │ │ ├── archive_util.pyi │ │ ├── bcppcompiler.pyi │ │ ├── ccompiler.pyi │ │ ├── cmd.pyi │ │ ├── command │ │ │ ├── __init__.pyi │ │ │ ├── bdist.pyi │ │ │ ├── bdist_dumb.pyi │ │ │ ├── bdist_msi.pyi │ │ │ ├── bdist_packager.pyi │ │ │ ├── bdist_rpm.pyi │ │ │ ├── bdist_wininst.pyi │ │ │ ├── build.pyi │ │ │ ├── build_clib.pyi │ │ │ ├── build_ext.pyi │ │ │ ├── build_py.pyi │ │ │ ├── build_scripts.pyi │ │ │ ├── check.pyi │ │ │ ├── clean.pyi │ │ │ ├── config.pyi │ │ │ ├── install.pyi │ │ │ ├── install_data.pyi │ │ │ ├── install_egg_info.pyi │ │ │ ├── install_headers.pyi │ │ │ ├── install_lib.pyi │ │ │ ├── install_scripts.pyi │ │ │ ├── register.pyi │ │ │ ├── sdist.pyi │ │ │ └── upload.pyi │ │ ├── config.pyi │ │ ├── core.pyi │ │ ├── cygwinccompiler.pyi │ │ ├── debug.pyi │ │ ├── dep_util.pyi │ │ ├── dir_util.pyi │ │ ├── dist.pyi │ │ ├── errors.pyi │ │ ├── extension.pyi │ │ ├── fancy_getopt.pyi │ │ ├── file_util.pyi │ │ ├── filelist.pyi │ │ ├── log.pyi │ │ ├── msvccompiler.pyi │ │ ├── spawn.pyi │ │ ├── sysconfig.pyi │ │ ├── text_file.pyi │ │ ├── unixccompiler.pyi │ │ ├── util.pyi │ │ └── version.pyi │ │ ├── doctest.pyi │ │ ├── dummy_threading.pyi │ │ ├── email │ │ ├── __init__.pyi │ │ ├── charset.pyi │ │ ├── contentmanager.pyi │ │ ├── encoders.pyi │ │ ├── errors.pyi │ │ ├── feedparser.pyi │ │ ├── generator.pyi │ │ ├── header.pyi │ │ ├── headerregistry.pyi │ │ ├── iterators.pyi │ │ ├── message.pyi │ │ ├── mime │ │ │ ├── __init__.pyi │ │ │ ├── application.pyi │ │ │ ├── audio.pyi │ │ │ ├── base.pyi │ │ │ ├── image.pyi │ │ │ ├── message.pyi │ │ │ ├── multipart.pyi │ │ │ ├── nonmultipart.pyi │ │ │ └── text.pyi │ │ ├── parser.pyi │ │ ├── policy.pyi │ │ └── utils.pyi │ │ ├── encodings │ │ ├── __init__.pyi │ │ └── utf_8.pyi │ │ ├── ensurepip │ │ └── __init__.pyi │ │ ├── enum.pyi │ │ ├── errno.pyi │ │ ├── faulthandler.pyi │ │ ├── fcntl.pyi │ │ ├── filecmp.pyi │ │ ├── fileinput.pyi │ │ ├── fnmatch.pyi │ │ ├── formatter.pyi │ │ ├── fractions.pyi │ │ ├── ftplib.pyi │ │ ├── functools.pyi │ │ ├── gc.pyi │ │ ├── genericpath.pyi │ │ ├── getopt.pyi │ │ ├── getpass.pyi │ │ ├── gettext.pyi │ │ ├── glob.pyi │ │ ├── graphlib.pyi │ │ ├── grp.pyi │ │ ├── gzip.pyi │ │ ├── hashlib.pyi │ │ ├── heapq.pyi │ │ ├── hmac.pyi │ │ ├── html │ │ ├── __init__.pyi │ │ ├── entities.pyi │ │ └── parser.pyi │ │ ├── http │ │ ├── __init__.pyi │ │ ├── client.pyi │ │ ├── cookiejar.pyi │ │ ├── cookies.pyi │ │ └── server.pyi │ │ ├── imaplib.pyi │ │ ├── imghdr.pyi │ │ ├── imp.pyi │ │ ├── importlib │ │ ├── __init__.pyi │ │ ├── abc.pyi │ │ ├── machinery.pyi │ │ ├── metadata.pyi │ │ ├── resources.pyi │ │ └── util.pyi │ │ ├── inspect.pyi │ │ ├── io.pyi │ │ ├── ipaddress.pyi │ │ ├── itertools.pyi │ │ ├── json │ │ ├── __init__.pyi │ │ ├── decoder.pyi │ │ ├── encoder.pyi │ │ └── tool.pyi │ │ ├── keyword.pyi │ │ ├── lib2to3 │ │ ├── __init__.pyi │ │ ├── pgen2 │ │ │ ├── __init__.pyi │ │ │ ├── driver.pyi │ │ │ ├── grammar.pyi │ │ │ ├── literals.pyi │ │ │ ├── parse.pyi │ │ │ ├── pgen.pyi │ │ │ ├── token.pyi │ │ │ └── tokenize.pyi │ │ ├── pygram.pyi │ │ └── pytree.pyi │ │ ├── linecache.pyi │ │ ├── locale.pyi │ │ ├── logging │ │ ├── __init__.pyi │ │ ├── config.pyi │ │ └── handlers.pyi │ │ ├── lzma.pyi │ │ ├── macpath.pyi │ │ ├── macurl2path.pyi │ │ ├── mailbox.pyi │ │ ├── mailcap.pyi │ │ ├── marshal.pyi │ │ ├── math.pyi │ │ ├── mimetypes.pyi │ │ ├── mmap.pyi │ │ ├── modulefinder.pyi │ │ ├── msilib │ │ ├── __init__.pyi │ │ ├── schema.pyi │ │ ├── sequence.pyi │ │ └── text.pyi │ │ ├── msvcrt.pyi │ │ ├── multiprocessing │ │ ├── __init__.pyi │ │ ├── connection.pyi │ │ ├── context.pyi │ │ ├── dummy │ │ │ ├── __init__.pyi │ │ │ └── connection.pyi │ │ ├── managers.pyi │ │ ├── pool.pyi │ │ ├── process.pyi │ │ ├── queues.pyi │ │ ├── shared_memory.pyi │ │ ├── sharedctypes.pyi │ │ ├── spawn.pyi │ │ └── synchronize.pyi │ │ ├── netrc.pyi │ │ ├── nis.pyi │ │ ├── nntplib.pyi │ │ ├── ntpath.pyi │ │ ├── nturl2path.pyi │ │ ├── numbers.pyi │ │ ├── opcode.pyi │ │ ├── operator.pyi │ │ ├── optparse.pyi │ │ ├── os │ │ ├── __init__.pyi │ │ └── path.pyi │ │ ├── ossaudiodev.pyi │ │ ├── parser.pyi │ │ ├── pathlib.pyi │ │ ├── pdb.pyi │ │ ├── pickle.pyi │ │ ├── pickletools.pyi │ │ ├── pipes.pyi │ │ ├── pkgutil.pyi │ │ ├── platform.pyi │ │ ├── plistlib.pyi │ │ ├── poplib.pyi │ │ ├── posix.pyi │ │ ├── posixpath.pyi │ │ ├── pprint.pyi │ │ ├── profile.pyi │ │ ├── pstats.pyi │ │ ├── pty.pyi │ │ ├── pwd.pyi │ │ ├── py_compile.pyi │ │ ├── pyclbr.pyi │ │ ├── pydoc.pyi │ │ ├── pydoc_data │ │ ├── __init__.pyi │ │ └── topics.pyi │ │ ├── pyexpat │ │ ├── __init__.pyi │ │ ├── errors.pyi │ │ └── model.pyi │ │ ├── queue.pyi │ │ ├── quopri.pyi │ │ ├── random.pyi │ │ ├── re.pyi │ │ ├── readline.pyi │ │ ├── reprlib.pyi │ │ ├── resource.pyi │ │ ├── rlcompleter.pyi │ │ ├── runpy.pyi │ │ ├── sched.pyi │ │ ├── secrets.pyi │ │ ├── select.pyi │ │ ├── selectors.pyi │ │ ├── shelve.pyi │ │ ├── shlex.pyi │ │ ├── shutil.pyi │ │ ├── signal.pyi │ │ ├── site.pyi │ │ ├── smtpd.pyi │ │ ├── smtplib.pyi │ │ ├── sndhdr.pyi │ │ ├── socket.pyi │ │ ├── socketserver.pyi │ │ ├── spwd.pyi │ │ ├── sqlite3 │ │ ├── __init__.pyi │ │ └── dbapi2.pyi │ │ ├── sre_compile.pyi │ │ ├── sre_constants.pyi │ │ ├── sre_parse.pyi │ │ ├── ssl.pyi │ │ ├── stat.pyi │ │ ├── statistics.pyi │ │ ├── string.pyi │ │ ├── stringprep.pyi │ │ ├── struct.pyi │ │ ├── subprocess.pyi │ │ ├── sunau.pyi │ │ ├── symbol.pyi │ │ ├── symtable.pyi │ │ ├── sys.pyi │ │ ├── sysconfig.pyi │ │ ├── syslog.pyi │ │ ├── tabnanny.pyi │ │ ├── tarfile.pyi │ │ ├── telnetlib.pyi │ │ ├── tempfile.pyi │ │ ├── termios.pyi │ │ ├── textwrap.pyi │ │ ├── this.pyi │ │ ├── threading.pyi │ │ ├── time.pyi │ │ ├── timeit.pyi │ │ ├── tkinter │ │ ├── __init__.pyi │ │ ├── commondialog.pyi │ │ ├── constants.pyi │ │ ├── dialog.pyi │ │ ├── filedialog.pyi │ │ ├── font.pyi │ │ ├── messagebox.pyi │ │ └── ttk.pyi │ │ ├── token.pyi │ │ ├── tokenize.pyi │ │ ├── trace.pyi │ │ ├── traceback.pyi │ │ ├── tracemalloc.pyi │ │ ├── tty.pyi │ │ ├── turtle.pyi │ │ ├── types.pyi │ │ ├── typing.pyi │ │ ├── unicodedata.pyi │ │ ├── unittest │ │ ├── __init__.pyi │ │ ├── async_case.pyi │ │ ├── case.pyi │ │ ├── loader.pyi │ │ ├── main.pyi │ │ ├── mock.pyi │ │ ├── result.pyi │ │ ├── runner.pyi │ │ ├── signals.pyi │ │ ├── suite.pyi │ │ └── util.pyi │ │ ├── urllib │ │ ├── __init__.pyi │ │ ├── error.pyi │ │ ├── parse.pyi │ │ ├── request.pyi │ │ ├── response.pyi │ │ └── robotparser.pyi │ │ ├── uu.pyi │ │ ├── uuid.pyi │ │ ├── venv │ │ └── __init__.pyi │ │ ├── warnings.pyi │ │ ├── wave.pyi │ │ ├── weakref.pyi │ │ ├── webbrowser.pyi │ │ ├── winreg.pyi │ │ ├── winsound.pyi │ │ ├── wsgiref │ │ ├── __init__.pyi │ │ ├── handlers.pyi │ │ ├── headers.pyi │ │ ├── simple_server.pyi │ │ ├── types.pyi │ │ ├── util.pyi │ │ └── validate.pyi │ │ ├── xdrlib.pyi │ │ ├── xml │ │ ├── __init__.pyi │ │ ├── dom │ │ │ ├── NodeFilter.pyi │ │ │ ├── __init__.pyi │ │ │ ├── domreg.pyi │ │ │ ├── expatbuilder.pyi │ │ │ ├── minicompat.pyi │ │ │ ├── minidom.pyi │ │ │ ├── pulldom.pyi │ │ │ └── xmlbuilder.pyi │ │ ├── etree │ │ │ ├── ElementInclude.pyi │ │ │ ├── ElementPath.pyi │ │ │ ├── ElementTree.pyi │ │ │ ├── __init__.pyi │ │ │ └── cElementTree.pyi │ │ ├── parsers │ │ │ ├── __init__.pyi │ │ │ └── expat │ │ │ │ ├── __init__.pyi │ │ │ │ ├── errors.pyi │ │ │ │ └── model.pyi │ │ └── sax │ │ │ ├── __init__.pyi │ │ │ ├── handler.pyi │ │ │ ├── saxutils.pyi │ │ │ └── xmlreader.pyi │ │ ├── xmlrpc │ │ ├── __init__.pyi │ │ ├── client.pyi │ │ └── server.pyi │ │ ├── xxlimited.pyi │ │ ├── zipapp.pyi │ │ ├── zipfile.pyi │ │ ├── zipimport.pyi │ │ ├── zlib.pyi │ │ └── zoneinfo │ │ └── __init__.pyi ├── typestate.py ├── typetraverser.py ├── typevars.py ├── util.py ├── version.py ├── visitor.py └── xml │ ├── mypy-html.css │ ├── mypy-html.xslt │ ├── mypy-txt.xslt │ └── mypy.xsd ├── mypy_bootstrap.ini ├── mypy_self_check.ini ├── mypyc ├── README.md ├── __init__.py ├── analysis │ ├── __init__.py │ └── dataflow.py ├── build.py ├── codegen │ ├── __init__.py │ ├── cstring.py │ ├── emit.py │ ├── emitclass.py │ ├── emitfunc.py │ ├── emitmodule.py │ ├── emitwrapper.py │ └── literals.py ├── common.py ├── crash.py ├── doc │ ├── Makefile │ ├── bool_operations.rst │ ├── compilation_units.rst │ ├── conf.py │ ├── cpython-timings.md │ ├── dev-intro.md │ ├── dict_operations.rst │ ├── differences_from_python.rst │ ├── float_operations.rst │ ├── future.md │ ├── getting_started.rst │ ├── index.rst │ ├── int_operations.rst │ ├── introduction.rst │ ├── list_operations.rst │ ├── make.bat │ ├── native_classes.rst │ ├── native_operations.rst │ ├── performance_tips_and_tricks.rst │ ├── set_operations.rst │ ├── str_operations.rst │ ├── tuple_operations.rst │ └── using_type_annotations.rst ├── errors.py ├── external │ └── googletest │ │ ├── LICENSE │ │ ├── README.md │ │ ├── include │ │ └── gtest │ │ │ ├── gtest-death-test.h │ │ │ ├── gtest-message.h │ │ │ ├── gtest-param-test.h │ │ │ ├── gtest-param-test.h.pump │ │ │ ├── gtest-printers.h │ │ │ ├── gtest-spi.h │ │ │ ├── gtest-test-part.h │ │ │ ├── gtest-typed-test.h │ │ │ ├── gtest.h │ │ │ ├── gtest_pred_impl.h │ │ │ ├── gtest_prod.h │ │ │ └── internal │ │ │ ├── custom │ │ │ ├── gtest-port.h │ │ │ ├── gtest-printers.h │ │ │ └── gtest.h │ │ │ ├── gtest-death-test-internal.h │ │ │ ├── gtest-filepath.h │ │ │ ├── gtest-internal.h │ │ │ ├── gtest-linked_ptr.h │ │ │ ├── gtest-param-util-generated.h │ │ │ ├── gtest-param-util-generated.h.pump │ │ │ ├── gtest-param-util.h │ │ │ ├── gtest-port-arch.h │ │ │ ├── gtest-port.h │ │ │ ├── gtest-string.h │ │ │ ├── gtest-tuple.h │ │ │ ├── gtest-tuple.h.pump │ │ │ ├── gtest-type-util.h │ │ │ └── gtest-type-util.h.pump │ │ ├── make │ │ └── Makefile │ │ └── src │ │ ├── gtest-all.cc │ │ ├── gtest-death-test.cc │ │ ├── gtest-filepath.cc │ │ ├── gtest-internal-inl.h │ │ ├── gtest-port.cc │ │ ├── gtest-printers.cc │ │ ├── gtest-test-part.cc │ │ ├── gtest-typed-test.cc │ │ ├── gtest.cc │ │ └── gtest_main.cc ├── ir │ ├── __init__.py │ ├── class_ir.py │ ├── func_ir.py │ ├── module_ir.py │ ├── ops.py │ ├── pprint.py │ └── rtypes.py ├── irbuild │ ├── __init__.py │ ├── builder.py │ ├── callable_class.py │ ├── classdef.py │ ├── context.py │ ├── env_class.py │ ├── expression.py │ ├── for_helpers.py │ ├── function.py │ ├── generator.py │ ├── ll_builder.py │ ├── main.py │ ├── mapper.py │ ├── nonlocalcontrol.py │ ├── prebuildvisitor.py │ ├── prepare.py │ ├── specialize.py │ ├── statement.py │ ├── targets.py │ ├── util.py │ ├── visitor.py │ └── vtable.py ├── lib-rt │ ├── CPy.h │ ├── dict_ops.c │ ├── exc_ops.c │ ├── generic_ops.c │ ├── getargs.c │ ├── getargsfast.c │ ├── init.c │ ├── int_ops.c │ ├── list_ops.c │ ├── misc_ops.c │ ├── module_shim.tmpl │ ├── mypyc_util.h │ ├── pythonsupport.h │ ├── set_ops.c │ ├── setup.py │ ├── str_ops.c │ ├── test_capi.cc │ └── tuple_ops.c ├── namegen.py ├── options.py ├── primitives │ ├── __init__.py │ ├── dict_ops.py │ ├── exc_ops.py │ ├── float_ops.py │ ├── generic_ops.py │ ├── int_ops.py │ ├── list_ops.py │ ├── misc_ops.py │ ├── registry.py │ ├── set_ops.py │ ├── str_ops.py │ └── tuple_ops.py ├── rt_subtype.py ├── sametype.py ├── subtype.py ├── test-data │ ├── analysis.test │ ├── commandline.test │ ├── driver │ │ └── driver.py │ ├── exceptions.test │ ├── fixtures │ │ ├── ir.py │ │ ├── testutil.py │ │ └── typing-full.pyi │ ├── irbuild-any.test │ ├── irbuild-basic.test │ ├── irbuild-classes.test │ ├── irbuild-dict.test │ ├── irbuild-generics.test │ ├── irbuild-int.test │ ├── irbuild-lists.test │ ├── irbuild-nested.test │ ├── irbuild-optional.test │ ├── irbuild-set.test │ ├── irbuild-statements.test │ ├── irbuild-str.test │ ├── irbuild-strip-asserts.test │ ├── irbuild-try.test │ ├── irbuild-tuple.test │ ├── irbuild-vectorcall.test │ ├── refcount.test │ ├── run-bench.test │ ├── run-bools.test │ ├── run-classes.test │ ├── run-dicts.test │ ├── run-exceptions.test │ ├── run-floats.test │ ├── run-functions.test │ ├── run-generators.test │ ├── run-imports.test │ ├── run-integers.test │ ├── run-lists.test │ ├── run-loops.test │ ├── run-misc.test │ ├── run-multimodule.test │ ├── run-mypy-sim.test │ ├── run-primitives.test │ ├── run-python37.test │ ├── run-python38.test │ ├── run-sets.test │ ├── run-strings.test │ ├── run-traits.test │ └── run-tuples.test ├── test │ ├── __init__.py │ ├── config.py │ ├── test_analysis.py │ ├── test_commandline.py │ ├── test_emit.py │ ├── test_emitfunc.py │ ├── test_emitwrapper.py │ ├── test_exceptions.py │ ├── test_external.py │ ├── test_irbuild.py │ ├── test_literals.py │ ├── test_namegen.py │ ├── test_pprint.py │ ├── test_rarray.py │ ├── test_refcount.py │ ├── test_run.py │ ├── test_serialization.py │ ├── test_struct.py │ ├── test_subtype.py │ ├── test_tuplename.py │ └── testutil.py └── transform │ ├── __init__.py │ ├── exceptions.py │ ├── refcount.py │ └── uninit.py ├── pyproject.toml ├── pytest.ini ├── runtests.py ├── scripts ├── find_type.py └── mypyc ├── setup.cfg ├── setup.py ├── test-data ├── .flake8 ├── packages │ ├── modulefinder-site-packages │ │ ├── baz.pth │ │ ├── baz │ │ │ ├── baz_pkg │ │ │ │ ├── __init__.py │ │ │ │ └── py.typed │ │ │ └── ns_baz_pkg │ │ │ │ ├── a.py │ │ │ │ └── py.typed │ │ ├── dne.pth │ │ ├── foo-stubs │ │ │ ├── __init__.pyi │ │ │ └── bar.pyi │ │ ├── foo │ │ │ ├── __init__.py │ │ │ └── bar.py │ │ ├── ignored.pth │ │ ├── neighbor.pth │ │ ├── ns_pkg_typed │ │ │ ├── a.py │ │ │ ├── b │ │ │ │ └── c.py │ │ │ └── py.typed │ │ ├── ns_pkg_untyped │ │ │ ├── a.py │ │ │ └── b │ │ │ │ └── c.py │ │ ├── pkg_typed │ │ │ ├── __init__.py │ │ │ ├── a.py │ │ │ ├── b │ │ │ │ ├── __init__.py │ │ │ │ └── c.py │ │ │ └── py.typed │ │ ├── pkg_untyped │ │ │ ├── __init__.py │ │ │ ├── a.py │ │ │ └── b │ │ │ │ ├── __init__.py │ │ │ │ └── c.py │ │ └── standalone.py │ ├── modulefinder-src │ │ ├── neighbor_pkg │ │ │ ├── __init__.py │ │ │ └── py.typed │ │ └── ns_neighbor_pkg │ │ │ ├── a.py │ │ │ └── py.typed │ ├── modulefinder │ │ ├── nsx-pkg1 │ │ │ └── nsx │ │ │ │ └── a │ │ │ │ └── __init__.py │ │ ├── nsx-pkg2 │ │ │ └── nsx │ │ │ │ └── b │ │ │ │ └── __init__.py │ │ ├── nsx-pkg3 │ │ │ └── nsx │ │ │ │ └── c │ │ │ │ └── c.py │ │ ├── nsy-pkg1 │ │ │ └── nsy │ │ │ │ └── a │ │ │ │ ├── __init__.py │ │ │ │ └── __init__.pyi │ │ ├── nsy-pkg2 │ │ │ └── nsy │ │ │ │ ├── b.pyi │ │ │ │ ├── b │ │ │ │ └── __init__.py │ │ │ │ ├── c.py │ │ │ │ └── c.pyi │ │ ├── pkg1 │ │ │ └── a.py │ │ ├── pkg2 │ │ │ └── b │ │ │ │ └── __init__.py │ │ └── readme.txt │ ├── typedpkg-stubs │ │ ├── setup.py │ │ └── typedpkg-stubs │ │ │ ├── __init__.pyi │ │ │ ├── py.typed │ │ │ └── sample.pyi │ ├── typedpkg │ │ ├── setup.py │ │ └── typedpkg │ │ │ ├── __init__.py │ │ │ ├── dne.py │ │ │ ├── pkg │ │ │ ├── __init__.py │ │ │ ├── aaa.py │ │ │ └── py.typed │ │ │ ├── py.typed │ │ │ └── sample.py │ └── typedpkg_ns │ │ ├── setup.py │ │ └── typedpkg_ns │ │ ├── __init__.py │ │ └── ns │ │ ├── __init__.py │ │ ├── bbb.py │ │ └── py.typed ├── samples │ ├── bottles.py │ ├── class.py │ ├── cmdline.py │ ├── crawl2.py │ ├── dict.py │ ├── fib.py │ ├── files.py │ ├── for.py │ ├── generators.py │ ├── greet.py │ ├── guess.py │ ├── hello.py │ ├── input.py │ ├── itertool.py │ ├── readme.txt │ └── regexp.py ├── stdlib-samples │ └── 3.2 │ │ ├── base64.py │ │ ├── fnmatch.py │ │ ├── genericpath.py │ │ ├── getopt.py │ │ ├── glob.py │ │ ├── posixpath.py │ │ ├── pprint.py │ │ ├── random.py │ │ ├── shutil.py │ │ ├── tempfile.py │ │ ├── test │ │ ├── __init__.py │ │ ├── mypy.ini │ │ ├── randv2_32.pck │ │ ├── randv2_64.pck │ │ ├── randv3.pck │ │ ├── subprocessdata │ │ │ ├── fd_status.py │ │ │ ├── input_reader.py │ │ │ ├── qcat.py │ │ │ ├── qgrep.py │ │ │ └── sigchild_ignore.py │ │ ├── support.py │ │ ├── test_base64.py │ │ ├── test_fnmatch.py │ │ ├── test_genericpath.py │ │ ├── test_getopt.py │ │ ├── test_glob.py │ │ ├── test_posixpath.py │ │ ├── test_pprint.py │ │ ├── test_random.py │ │ ├── test_set.py │ │ ├── test_shutil.py │ │ ├── test_tempfile.py │ │ ├── test_textwrap.py │ │ └── tf_inherit_check.py │ │ └── textwrap.py ├── stubgen │ └── pybind11_mypy_demo │ │ ├── __init__.pyi │ │ └── basics.pyi └── unit │ ├── README.md │ ├── check-abstract.test │ ├── check-annotated.test │ ├── check-async-await.test │ ├── check-attr.test │ ├── check-basic.test │ ├── check-bound.test │ ├── check-callable.test │ ├── check-class-namedtuple.test │ ├── check-classes.test │ ├── check-classvar.test │ ├── check-columns.test │ ├── check-ctypes.test │ ├── check-custom-plugin.test │ ├── check-dataclasses.test │ ├── check-default-plugin.test │ ├── check-dynamic-typing.test │ ├── check-enum.test │ ├── check-errorcodes.test │ ├── check-expressions.test │ ├── check-fastparse.test │ ├── check-final.test │ ├── check-flags.test │ ├── check-functions.test │ ├── check-generic-alias.test │ ├── check-generic-subtyping.test │ ├── check-generics.test │ ├── check-ignore.test │ ├── check-incomplete-fixture.test │ ├── check-incremental.test │ ├── check-inference-context.test │ ├── check-inference.test │ ├── check-inline-config.test │ ├── check-isinstance.test │ ├── check-kwargs.test │ ├── check-lists.test │ ├── check-literal.test │ ├── check-modules-case.test │ ├── check-modules.test │ ├── check-multiple-inheritance.test │ ├── check-namedtuple.test │ ├── check-narrowing.test │ ├── check-newsemanal.test │ ├── check-newsyntax.test │ ├── check-newtype.test │ ├── check-optional.test │ ├── check-overloading.test │ ├── check-parameter-specification.test │ ├── check-protocols.test │ ├── check-python2.test │ ├── check-python38.test │ ├── check-python39.test │ ├── check-redefine.test │ ├── check-reports.test │ ├── check-selftype.test │ ├── check-semanal-error.test │ ├── check-serialize.test │ ├── check-statements.test │ ├── check-super.test │ ├── check-tuples.test │ ├── check-type-aliases.test │ ├── check-type-checks.test │ ├── check-type-promotion.test │ ├── check-typeddict.test │ ├── check-typeguard.test │ ├── check-typevar-values.test │ ├── check-underscores.test │ ├── check-union-or-syntax.test │ ├── check-unions.test │ ├── check-unreachable-code.test │ ├── check-unsupported.test │ ├── check-varargs.test │ ├── check-warnings.test │ ├── cmdline.test │ ├── daemon.test │ ├── deps-classes.test │ ├── deps-expressions.test │ ├── deps-generics.test │ ├── deps-statements.test │ ├── deps-types.test │ ├── deps.test │ ├── diff.test │ ├── envvars.test │ ├── errorstream.test │ ├── fine-grained-blockers.test │ ├── fine-grained-cache-incremental.test │ ├── fine-grained-cycles.test │ ├── fine-grained-follow-imports.test │ ├── fine-grained-modules.test │ ├── fine-grained-suggest.test │ ├── fine-grained.test │ ├── fixtures │ ├── __init_subclass__.pyi │ ├── __new__.pyi │ ├── alias.pyi │ ├── args.pyi │ ├── async_await.pyi │ ├── attr.pyi │ ├── bool.pyi │ ├── bool_py2.pyi │ ├── callable.pyi │ ├── classmethod.pyi │ ├── complex.pyi │ ├── complex_tuple.pyi │ ├── dict.pyi │ ├── divmod.pyi │ ├── exception.pyi │ ├── f_string.pyi │ ├── fine_grained.pyi │ ├── float.pyi │ ├── floatdict.pyi │ ├── floatdict_python2.pyi │ ├── for.pyi │ ├── function.pyi │ ├── isinstance.pyi │ ├── isinstancelist.pyi │ ├── list.pyi │ ├── module.pyi │ ├── module_all.pyi │ ├── module_all_python2.pyi │ ├── notimplemented.pyi │ ├── object_with_init_subclass.pyi │ ├── ops.pyi │ ├── primitives.pyi │ ├── property.pyi │ ├── property_py2.pyi │ ├── python2.pyi │ ├── set.pyi │ ├── slice.pyi │ ├── staticmethod.pyi │ ├── transform.pyi │ ├── tuple-simple.pyi │ ├── tuple.pyi │ ├── type.pyi │ ├── typing-async.pyi │ ├── typing-full.pyi │ ├── typing-medium.pyi │ ├── typing-typeddict.pyi │ └── union.pyi │ ├── hacks.txt │ ├── lib-stub │ ├── __builtin__.pyi │ ├── abc.pyi │ ├── attr │ │ ├── __init__.pyi │ │ └── converters.pyi │ ├── blocker.pyi │ ├── blocker2.pyi │ ├── broken.pyi │ ├── builtins.pyi │ ├── collections.pyi │ ├── contextlib.pyi │ ├── dataclasses.pyi │ ├── enum.pyi │ ├── future │ │ ├── __init__.pyi │ │ └── utils.pyi │ ├── mypy_extensions.pyi │ ├── six.pyi │ ├── sys.pyi │ ├── types.pyi │ ├── typing.pyi │ └── typing_extensions.pyi │ ├── merge.test │ ├── parse-errors.test │ ├── parse-python2.test │ ├── parse.test │ ├── pep561.test │ ├── plugins │ ├── arg_kinds.py │ ├── arg_names.py │ ├── attrhook.py │ ├── attrhook2.py │ ├── badreturn.py │ ├── badreturn2.py │ ├── callable_instance.py │ ├── class_callable.py │ ├── common_api_incremental.py │ ├── config_data.py │ ├── customentry.py │ ├── customize_mro.py │ ├── decimal_to_int.py │ ├── depshook.py │ ├── descriptor.py │ ├── dyn_class.py │ ├── dyn_class_from_method.py │ ├── fnplugin.py │ ├── fully_qualified_test_hook.py │ ├── function_sig_hook.py │ ├── method_sig_hook.py │ ├── named_callable.py │ ├── noentry.py │ ├── plugin2.py │ ├── type_anal_hook.py │ └── union_method.py │ ├── python2eval.test │ ├── pythoneval-asyncio.test │ ├── pythoneval.test │ ├── reports.test │ ├── semanal-abstractclasses.test │ ├── semanal-basic.test │ ├── semanal-classes.test │ ├── semanal-classvar.test │ ├── semanal-errors.test │ ├── semanal-expressions.test │ ├── semanal-modules.test │ ├── semanal-namedtuple.test │ ├── semanal-python2.test │ ├── semanal-statements.test │ ├── semanal-symtable.test │ ├── semanal-typealiases.test │ ├── semanal-typeddict.test │ ├── semanal-typeinfo.test │ ├── semanal-types.test │ ├── semenal-literal.test │ ├── stubgen.test │ └── typexport-basic.test ├── test-requirements.txt └── tox.ini /.github/ISSUE_TEMPLATE/documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation 3 | about: Report a problem with the documentation 4 | labels: "documentation" 5 | --- 6 | 7 | **Documentation** 8 | 9 | (A clear and concise description of the issue.) 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature 3 | about: Submit a proposal for a new mypy feature 4 | labels: "feature" 5 | --- 6 | 7 | **Feature** 8 | 9 | (A clear and concise description of your feature proposal.) 10 | 11 | **Pitch** 12 | 13 | (Please explain why this feature should be implemented and how it would be used. Add examples, if applicable.) 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Questions and Help 3 | about: If you have questions, please check the below links 4 | labels: "question" 5 | --- 6 | 7 | **Questions and Help** 8 | 9 | _Please note that this issue tracker is not a help form and this issue will be closed._ 10 | 11 | Please check here instead: 12 | 13 | - [Website](http://www.mypy-lang.org/) 14 | - [Documentation](https://mypy.readthedocs.io/) 15 | - [Gitter](https://gitter.im/python/typing) 16 | -------------------------------------------------------------------------------- /.github/workflows/test_stubgenc.yml: -------------------------------------------------------------------------------- 1 | name: Test stubgenc on pybind11-mypy-demo 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | tags: ['*'] 7 | pull_request: 8 | paths: 9 | - 'misc/test-stubgenc.sh' 10 | - 'mypy/stubgenc.py' 11 | - 'mypy/stubdoc.py' 12 | - 'test-data/stubgen/**' 13 | 14 | jobs: 15 | stubgenc: 16 | # Check stub file generation for a small pybind11 project 17 | # (full text match is required to pass) 18 | runs-on: ubuntu-latest 19 | steps: 20 | 21 | - uses: actions/checkout@v2 22 | 23 | - name: initialize submodules 24 | run: git submodule update --init 25 | 26 | - name: Setup 🐍 3.8 27 | uses: actions/setup-python@v2 28 | with: 29 | python-version: 3.8 30 | 31 | - name: Test stubgenc 32 | run: misc/test-stubgenc.sh -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | __pycache__ 3 | *.py[cod] 4 | *~ 5 | /build 6 | /env*/ 7 | docs/build/ 8 | docs/source/_build 9 | mypyc/doc/_build 10 | *.iml 11 | /out/ 12 | .venv*/ 13 | .mypy_cache/ 14 | .incremental_checker_cache.json 15 | .cache 16 | dmypy.json 17 | .dmypy.json 18 | 19 | # Packages 20 | *.egg 21 | *.egg-info 22 | *.eggs 23 | 24 | # IDEs 25 | .idea 26 | .vscode 27 | 28 | # vim temporary files 29 | .*.sw? 30 | *.sw? 31 | 32 | # Operating Systems 33 | .DS_Store 34 | 35 | # Coverage Files 36 | htmlcov 37 | .coverage* 38 | 39 | # pytest cache 40 | .pytest_cache/ 41 | 42 | # virtualenv 43 | .Python 44 | bin/ 45 | lib/ 46 | include/ 47 | 48 | .tox 49 | pip-wheel-metadata 50 | 51 | 52 | test_capi 53 | *.o 54 | *.a 55 | test_capi 56 | /.mypyc-flake8-cache.json 57 | /mypyc/lib-rt/build/ 58 | /mypyc/lib-rt/*.so 59 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/.gitmodules -------------------------------------------------------------------------------- /build-requirements.txt: -------------------------------------------------------------------------------- 1 | -r mypy-requirements.txt 2 | types-typed-ast>=1.4.0,<1.5.0 3 | types-toml>=0.0 4 | types-enum34>=0.0; python_version == '3.5' 5 | -------------------------------------------------------------------------------- /conftest.py: -------------------------------------------------------------------------------- 1 | import os.path 2 | 3 | pytest_plugins = [ 4 | 'mypy.test.data', 5 | ] 6 | 7 | 8 | def pytest_configure(config): 9 | mypy_source_root = os.path.dirname(os.path.abspath(__file__)) 10 | if os.getcwd() != mypy_source_root: 11 | os.chdir(mypy_source_root) 12 | 13 | 14 | # This function name is special to pytest. See 15 | # http://doc.pytest.org/en/latest/writing_plugins.html#initialization-command-line-and-configuration-hooks 16 | def pytest_addoption(parser) -> None: 17 | parser.addoption('--bench', action='store_true', default=False, 18 | help='Enable the benchmark test runs') 19 | -------------------------------------------------------------------------------- /docs/requirements-docs.txt: -------------------------------------------------------------------------------- 1 | Sphinx >= 1.4.4 2 | sphinx-rtd-theme >= 0.1.9 3 | -------------------------------------------------------------------------------- /misc/clean-mypyc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Cleaning C/C++ build artifacts..." 3 | (cd mypyc/lib-rt; make clean) 4 | (cd mypyc/external/googletest/make; make clean) 5 | -------------------------------------------------------------------------------- /misc/remove-eol-whitespace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Remove trailing whitespace from all non-binary files in a git repo. 4 | 5 | # From https://gist.github.com/dpaluy/3690668; originally from here: 6 | # http://unix.stackexchange.com/questions/36233/how-to-skip-file-in-sed-if-it-contains-regex/36240#36240 7 | 8 | git grep -I --name-only -z -e '' | xargs -0 sed -i -e 's/[ \t]\+\(\r\?\)$/\1/' 9 | -------------------------------------------------------------------------------- /misc/test-stubgenc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script is expected to be run from root of the mypy repo 3 | 4 | # Install dependencies, demo project and mypy 5 | python -m pip install -r test-requirements.txt 6 | python -m pip install pybind11-mypy-demo==0.0.1 7 | python -m pip install . 8 | 9 | # Remove expected stubs and generate new inplace 10 | rm -rf test-data/stubgen/pybind11_mypy_demo 11 | stubgen -p pybind11_mypy_demo -o test-data/stubgen/ 12 | 13 | # Compare generated stubs to expected ones 14 | git diff --exit-code test-data/stubgen/pybind11_mypy_demo 15 | -------------------------------------------------------------------------------- /misc/trigger_wheel_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | # Trigger a build of mypyc compiled mypy wheels by updating the mypy 4 | # submodule in the git repo that drives those builds. 5 | 6 | # $WHEELS_PUSH_TOKEN is stored in travis and is an API token for the 7 | # mypy-build-bot account. 8 | 9 | git config --global user.email "nobody" 10 | git config --global user.name "mypy wheels autopush" 11 | 12 | COMMIT=$(git rev-parse HEAD) 13 | pip install -r mypy-requirements.txt 14 | V=$(python3 -m mypy --version) 15 | V=$(echo "$V" | cut -d" " -f2) 16 | 17 | git clone https://${WHEELS_PUSH_TOKEN}@github.com/mypyc/mypy_mypyc-wheels.git build 18 | cd build 19 | echo $COMMIT > mypy_commit 20 | git commit -am "Build wheels for mypy $V" 21 | git tag v$V 22 | # Push a tag, but no need to push the change to master 23 | git push --tags 24 | -------------------------------------------------------------------------------- /mypy-requirements.txt: -------------------------------------------------------------------------------- 1 | typing_extensions>=3.7.4 2 | mypy_extensions>=0.4.3,<0.5.0 3 | typed_ast>=1.4.0,<1.5.0 4 | types-typing-extensions>=3.7.0 5 | types-mypy-extensions>=0.4.0 6 | toml 7 | -------------------------------------------------------------------------------- /mypy/__init__.py: -------------------------------------------------------------------------------- 1 | # This page intentionally left blank 2 | -------------------------------------------------------------------------------- /mypy/__main__.py: -------------------------------------------------------------------------------- 1 | """Mypy type checker command line tool.""" 2 | 3 | import sys 4 | import os 5 | 6 | from mypy.main import main 7 | 8 | 9 | def console_entry() -> None: 10 | try: 11 | main(None, sys.stdout, sys.stderr) 12 | sys.stdout.flush() 13 | sys.stderr.flush() 14 | except BrokenPipeError: 15 | # Python flushes standard streams on exit; redirect remaining output 16 | # to devnull to avoid another BrokenPipeError at shutdown 17 | devnull = os.open(os.devnull, os.O_WRONLY) 18 | os.dup2(devnull, sys.stdout.fileno()) 19 | sys.exit(2) 20 | 21 | 22 | if __name__ == '__main__': 23 | console_entry() 24 | -------------------------------------------------------------------------------- /mypy/dmypy/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/dmypy/__init__.py -------------------------------------------------------------------------------- /mypy/dmypy/__main__.py: -------------------------------------------------------------------------------- 1 | from mypy.dmypy.client import console_entry 2 | 3 | if __name__ == '__main__': 4 | console_entry() 5 | -------------------------------------------------------------------------------- /mypy/freetree.py: -------------------------------------------------------------------------------- 1 | """Generic node traverser visitor""" 2 | 3 | from mypy.traverser import TraverserVisitor 4 | from mypy.nodes import Block, MypyFile 5 | 6 | 7 | class TreeFreer(TraverserVisitor): 8 | def visit_block(self, block: Block) -> None: 9 | super().visit_block(block) 10 | block.body.clear() 11 | 12 | 13 | def free_tree(tree: MypyFile) -> None: 14 | """Free all the ASTs associated with a module. 15 | 16 | This needs to be done recursively, since symbol tables contain 17 | references to definitions, so those won't be freed but we want their 18 | contents to be. 19 | """ 20 | tree.accept(TreeFreer()) 21 | tree.defs.clear() 22 | -------------------------------------------------------------------------------- /mypy/ordered_dict.py: -------------------------------------------------------------------------------- 1 | # OrderedDict is kind of slow, so for most of our uses in Python 3.6 2 | # and later we'd rather just use dict 3 | 4 | import sys 5 | 6 | if sys.version_info < (3, 6): 7 | from collections import OrderedDict as OrderedDict 8 | else: 9 | OrderedDict = dict 10 | -------------------------------------------------------------------------------- /mypy/plugins/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/plugins/__init__.py -------------------------------------------------------------------------------- /mypy/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. The mypy package uses inline types. 2 | -------------------------------------------------------------------------------- /mypy/server/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/server/__init__.py -------------------------------------------------------------------------------- /mypy/server/target.py: -------------------------------------------------------------------------------- 1 | def trigger_to_target(s: str) -> str: 2 | assert s[0] == '<' 3 | # Strip off the angle brackets 4 | s = s[1:-1] 5 | # If there is a [wildcard] or similar, strip that off too 6 | if s[-1] == ']': 7 | s = s.split('[')[0] 8 | return s 9 | -------------------------------------------------------------------------------- /mypy/state.py: -------------------------------------------------------------------------------- 1 | from contextlib import contextmanager 2 | from typing import Optional, Tuple, Iterator 3 | 4 | # These are global mutable state. Don't add anything here unless there's a very 5 | # good reason. 6 | 7 | # Value varies by file being processed 8 | strict_optional = False 9 | find_occurrences = None # type: Optional[Tuple[str, str]] 10 | 11 | 12 | @contextmanager 13 | def strict_optional_set(value: bool) -> Iterator[None]: 14 | global strict_optional 15 | saved = strict_optional 16 | strict_optional = value 17 | yield 18 | strict_optional = saved 19 | -------------------------------------------------------------------------------- /mypy/test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/test/__init__.py -------------------------------------------------------------------------------- /mypy/test/collect.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/test/collect.py -------------------------------------------------------------------------------- /mypy/test/testfinegrainedcache.py: -------------------------------------------------------------------------------- 1 | """Tests for fine-grained incremental checking using the cache. 2 | 3 | All of the real code for this lives in testfinegrained.py. 4 | """ 5 | 6 | # We can't "import FineGrainedSuite from ..." because that will cause pytest 7 | # to collect the non-caching tests when running this file. 8 | import mypy.test.testfinegrained 9 | 10 | 11 | class FineGrainedCacheSuite(mypy.test.testfinegrained.FineGrainedSuite): 12 | use_cache = True 13 | test_name_suffix = '_cached' 14 | files = ( 15 | mypy.test.testfinegrained.FineGrainedSuite.files + ['fine-grained-cache-incremental.test']) 16 | -------------------------------------------------------------------------------- /mypy/test/testmypyc.py: -------------------------------------------------------------------------------- 1 | """A basic check to make sure that we are using a mypyc-compiled version when expected.""" 2 | 3 | import mypy 4 | 5 | from unittest import TestCase 6 | import os 7 | 8 | 9 | class MypycTest(TestCase): 10 | def test_using_mypyc(self) -> None: 11 | if os.getenv('TEST_MYPYC', None) == '1': 12 | assert not mypy.__file__.endswith('.py'), "Expected to find a mypyc-compiled version" 13 | -------------------------------------------------------------------------------- /mypy/test/testutil.py: -------------------------------------------------------------------------------- 1 | import os 2 | from unittest import mock, TestCase 3 | 4 | from mypy.util import get_terminal_width 5 | 6 | 7 | class TestGetTerminalSize(TestCase): 8 | def test_get_terminal_size_in_pty_defaults_to_80(self) -> None: 9 | # when run using a pty, `os.get_terminal_size()` returns `0, 0` 10 | ret = os.terminal_size((0, 0)) 11 | mock_environ = os.environ.copy() 12 | mock_environ.pop('COLUMNS', None) 13 | with mock.patch.object(os, 'get_terminal_size', return_value=ret): 14 | with mock.patch.dict(os.environ, values=mock_environ, clear=True): 15 | assert get_terminal_width() == 80 16 | -------------------------------------------------------------------------------- /mypy/test/update.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/test/update.py -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/CGIHTTPServer.pyi: -------------------------------------------------------------------------------- 1 | import SimpleHTTPServer 2 | from typing import List 3 | 4 | class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): 5 | cgi_directories: List[str] 6 | def do_POST(self) -> None: ... 7 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/SimpleHTTPServer.pyi: -------------------------------------------------------------------------------- 1 | import BaseHTTPServer 2 | from StringIO import StringIO 3 | from typing import IO, Any, AnyStr, Mapping, Optional, Union 4 | 5 | class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): 6 | server_version: str 7 | def do_GET(self) -> None: ... 8 | def do_HEAD(self) -> None: ... 9 | def send_head(self) -> Optional[IO[str]]: ... 10 | def list_directory(self, path: Union[str, unicode]) -> Optional[StringIO[Any]]: ... 11 | def translate_path(self, path: AnyStr) -> AnyStr: ... 12 | def copyfile(self, source: IO[AnyStr], outputfile: IO[AnyStr]): ... 13 | def guess_type(self, path: Union[str, unicode]) -> str: ... 14 | extensions_map: Mapping[str, str] 15 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/UserList.pyi: -------------------------------------------------------------------------------- 1 | from typing import Iterable, List, MutableSequence, TypeVar, Union, overload 2 | 3 | _T = TypeVar("_T") 4 | _S = TypeVar("_S") 5 | 6 | class UserList(MutableSequence[_T]): 7 | data: List[_T] 8 | def insert(self, index: int, object: _T) -> None: ... 9 | @overload 10 | def __setitem__(self, i: int, o: _T) -> None: ... 11 | @overload 12 | def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... 13 | def __delitem__(self, i: Union[int, slice]) -> None: ... 14 | def __len__(self) -> int: ... 15 | @overload 16 | def __getitem__(self, i: int) -> _T: ... 17 | @overload 18 | def __getitem__(self: _S, s: slice) -> _S: ... 19 | def sort(self) -> None: ... 20 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/_functools.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Callable, Dict, Iterable, Optional, Tuple, TypeVar, overload 2 | 3 | _T = TypeVar("_T") 4 | _S = TypeVar("_S") 5 | @overload 6 | def reduce(function: Callable[[_T, _T], _T], sequence: Iterable[_T]) -> _T: ... 7 | @overload 8 | def reduce(function: Callable[[_T, _S], _T], sequence: Iterable[_S], initial: _T) -> _T: ... 9 | 10 | class partial(object): 11 | func: Callable[..., Any] 12 | args: Tuple[Any, ...] 13 | keywords: Dict[str, Any] 14 | def __init__(self, func: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... 15 | def __call__(self, *args: Any, **kwargs: Any) -> Any: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/_hotshot.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, Generic, List, Tuple 2 | 3 | def coverage(a: str) -> Any: ... 4 | def logreader(a: str) -> LogReaderType: ... 5 | def profiler(a: str, *args, **kwargs) -> Any: ... 6 | def resolution() -> Tuple[Any, ...]: ... 7 | 8 | class LogReaderType(object): 9 | def close(self) -> None: ... 10 | def fileno(self) -> int: ... 11 | 12 | class ProfilerType(object): 13 | def addinfo(self, a: str, b: str) -> None: ... 14 | def close(self) -> None: ... 15 | def fileno(self) -> int: ... 16 | def runcall(self, *args, **kwargs) -> Any: ... 17 | def runcode(self, a, b, *args, **kwargs) -> Any: ... 18 | def start(self) -> None: ... 19 | def stop(self) -> None: ... 20 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/_json.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, Generic, List, Tuple 2 | 3 | def encode_basestring_ascii(*args, **kwargs) -> str: ... 4 | def scanstring(a, b, *args, **kwargs) -> Tuple[Any, ...]: ... 5 | 6 | class Encoder(object): ... 7 | class Scanner(object): ... 8 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/_md5.pyi: -------------------------------------------------------------------------------- 1 | blocksize: int 2 | digest_size: int 3 | 4 | class MD5Type(object): 5 | name: str 6 | block_size: int 7 | digest_size: int 8 | def copy(self) -> MD5Type: ... 9 | def digest(self) -> str: ... 10 | def hexdigest(self) -> str: ... 11 | def update(self, arg: str) -> None: ... 12 | 13 | def new(arg: str = ...) -> MD5Type: ... 14 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/_sha.pyi: -------------------------------------------------------------------------------- 1 | blocksize: int 2 | block_size: int 3 | digest_size: int 4 | 5 | class sha(object): # not actually exposed 6 | name: str 7 | block_size: int 8 | digest_size: int 9 | digestsize: int 10 | def copy(self) -> sha: ... 11 | def digest(self) -> str: ... 12 | def hexdigest(self) -> str: ... 13 | def update(self, arg: str) -> None: ... 14 | 15 | def new(arg: str = ...) -> sha: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/_sha256.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | class sha224(object): 4 | name: str 5 | block_size: int 6 | digest_size: int 7 | digestsize: int 8 | def __init__(self, init: Optional[str]) -> None: ... 9 | def copy(self) -> sha224: ... 10 | def digest(self) -> str: ... 11 | def hexdigest(self) -> str: ... 12 | def update(self, arg: str) -> None: ... 13 | 14 | class sha256(object): 15 | name: str 16 | block_size: int 17 | digest_size: int 18 | digestsize: int 19 | def __init__(self, init: Optional[str]) -> None: ... 20 | def copy(self) -> sha256: ... 21 | def digest(self) -> str: ... 22 | def hexdigest(self) -> str: ... 23 | def update(self, arg: str) -> None: ... 24 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/_sha512.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | class sha384(object): 4 | name: str 5 | block_size: int 6 | digest_size: int 7 | digestsize: int 8 | def __init__(self, init: Optional[str]) -> None: ... 9 | def copy(self) -> sha384: ... 10 | def digest(self) -> str: ... 11 | def hexdigest(self) -> str: ... 12 | def update(self, arg: str) -> None: ... 13 | 14 | class sha512(object): 15 | name: str 16 | block_size: int 17 | digest_size: int 18 | digestsize: int 19 | def __init__(self, init: Optional[str]) -> None: ... 20 | def copy(self) -> sha512: ... 21 | def digest(self) -> str: ... 22 | def hexdigest(self) -> str: ... 23 | def update(self, arg: str) -> None: ... 24 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/_threading_local.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | class _localbase(object): ... 4 | 5 | class local(_localbase): 6 | def __getattribute__(self, name: str) -> Any: ... 7 | def __setattr__(self, name: str, value: Any) -> None: ... 8 | def __delattr__(self, name: str) -> None: ... 9 | def __del__(self) -> None: ... 10 | 11 | def _patch(self: local) -> None: ... 12 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/atexit.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, TypeVar 2 | 3 | _FT = TypeVar("_FT") 4 | 5 | def register(func: _FT, *args: Any, **kargs: Any) -> _FT: ... 6 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/commands.pyi: -------------------------------------------------------------------------------- 1 | from typing import AnyStr, Text, Tuple, overload 2 | 3 | def getstatus(file: Text) -> str: ... 4 | def getoutput(cmd: Text) -> str: ... 5 | def getstatusoutput(cmd: Text) -> Tuple[int, str]: ... 6 | @overload 7 | def mk2arg(head: bytes, x: bytes) -> bytes: ... 8 | @overload 9 | def mk2arg(head: Text, x: Text) -> Text: ... 10 | def mkarg(x: AnyStr) -> AnyStr: ... 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/compileall.pyi: -------------------------------------------------------------------------------- 1 | from _typeshed import AnyPath 2 | from typing import Any, Optional, Pattern 3 | 4 | # rx can be any object with a 'search' method; once we have Protocols we can change the type 5 | def compile_dir( 6 | dir: AnyPath, 7 | maxlevels: int = ..., 8 | ddir: Optional[AnyPath] = ..., 9 | force: bool = ..., 10 | rx: Optional[Pattern[Any]] = ..., 11 | quiet: int = ..., 12 | ) -> int: ... 13 | def compile_file( 14 | fullname: AnyPath, ddir: Optional[AnyPath] = ..., force: bool = ..., rx: Optional[Pattern[Any]] = ..., quiet: int = ... 15 | ) -> int: ... 16 | def compile_path(skip_curdir: bool = ..., maxlevels: int = ..., force: bool = ..., quiet: int = ...) -> int: ... 17 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/copy_reg.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Callable, Hashable, List, Optional, SupportsInt, Tuple, TypeVar, Union 2 | 3 | _TypeT = TypeVar("_TypeT", bound=type) 4 | _Reduce = Union[Tuple[Callable[..., _TypeT], Tuple[Any, ...]], Tuple[Callable[..., _TypeT], Tuple[Any, ...], Optional[Any]]] 5 | 6 | __all__: List[str] 7 | 8 | def pickle( 9 | ob_type: _TypeT, 10 | pickle_function: Callable[[_TypeT], Union[str, _Reduce[_TypeT]]], 11 | constructor_ob: Optional[Callable[[_Reduce[_TypeT]], _TypeT]] = ..., 12 | ) -> None: ... 13 | def constructor(object: Callable[[_Reduce[_TypeT]], _TypeT]) -> None: ... 14 | def add_extension(module: Hashable, name: Hashable, code: SupportsInt) -> None: ... 15 | def remove_extension(module: Hashable, name: Hashable, code: int) -> None: ... 16 | def clear_extension_cache() -> None: ... 17 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/dircache.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, MutableSequence, Text, Union 2 | 3 | def reset() -> None: ... 4 | def listdir(path: Text) -> List[str]: ... 5 | 6 | opendir = listdir 7 | 8 | def annotate(head: Text, list: Union[MutableSequence[str], MutableSequence[Text], MutableSequence[Union[str, Text]]]) -> None: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/archive_util.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | def make_archive( 4 | base_name: str, 5 | format: str, 6 | root_dir: Optional[str] = ..., 7 | base_dir: Optional[str] = ..., 8 | verbose: int = ..., 9 | dry_run: int = ..., 10 | ) -> str: ... 11 | def make_tarball(base_name: str, base_dir: str, compress: Optional[str] = ..., verbose: int = ..., dry_run: int = ...) -> str: ... 12 | def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., dry_run: int = ...) -> str: ... 13 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/bcppcompiler.pyi: -------------------------------------------------------------------------------- 1 | from distutils.ccompiler import CCompiler 2 | 3 | class BCPPCompiler(CCompiler): ... 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/bdist.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/bdist.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/bdist_dumb.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/bdist_dumb.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/bdist_msi.pyi: -------------------------------------------------------------------------------- 1 | from distutils.cmd import Command 2 | 3 | class bdist_msi(Command): 4 | def initialize_options(self) -> None: ... 5 | def finalize_options(self) -> None: ... 6 | def run(self) -> None: ... 7 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/bdist_packager.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/bdist_packager.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/bdist_rpm.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/bdist_rpm.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/bdist_wininst.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/bdist_wininst.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/build.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/build.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/build_clib.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/build_clib.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/build_ext.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/build_ext.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/build_py.pyi: -------------------------------------------------------------------------------- 1 | from distutils.cmd import Command 2 | 3 | class build_py(Command): 4 | def initialize_options(self) -> None: ... 5 | def finalize_options(self) -> None: ... 6 | def run(self) -> None: ... 7 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/build_scripts.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/build_scripts.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/check.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/check.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/clean.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/clean.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/install.pyi: -------------------------------------------------------------------------------- 1 | from distutils.cmd import Command 2 | from typing import Optional, Text 3 | 4 | class install(Command): 5 | user: bool 6 | prefix: Optional[Text] 7 | home: Optional[Text] 8 | root: Optional[Text] 9 | install_lib: Optional[Text] 10 | def initialize_options(self) -> None: ... 11 | def finalize_options(self) -> None: ... 12 | def run(self) -> None: ... 13 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/install_data.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/install_data.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/install_egg_info.pyi: -------------------------------------------------------------------------------- 1 | from distutils.cmd import Command 2 | from typing import ClassVar, List, Optional, Tuple 3 | 4 | class install_egg_info(Command): 5 | description: ClassVar[str] 6 | user_options: ClassVar[List[Tuple[str, Optional[str], str]]] 7 | def initialize_options(self) -> None: ... 8 | def finalize_options(self) -> None: ... 9 | def run(self) -> None: ... 10 | def get_outputs(self) -> List[str]: ... 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/install_headers.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/install_headers.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/install_lib.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/install_lib.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/install_scripts.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/install_scripts.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/register.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/register.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/sdist.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/distutils/command/sdist.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/command/upload.pyi: -------------------------------------------------------------------------------- 1 | from distutils.config import PyPIRCCommand 2 | from typing import ClassVar, List, Optional, Tuple 3 | 4 | class upload(PyPIRCCommand): 5 | description: ClassVar[str] 6 | boolean_options: ClassVar[List[str]] 7 | def run(self) -> None: ... 8 | def upload_file(self, command, pyversion, filename) -> None: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/config.pyi: -------------------------------------------------------------------------------- 1 | from abc import abstractmethod 2 | from distutils.cmd import Command 3 | from typing import ClassVar, List, Optional, Tuple 4 | 5 | DEFAULT_PYPIRC: str 6 | 7 | class PyPIRCCommand(Command): 8 | DEFAULT_REPOSITORY: ClassVar[str] 9 | DEFAULT_REALM: ClassVar[str] 10 | repository: None 11 | realm: None 12 | user_options: ClassVar[List[Tuple[str, Optional[str], str]]] 13 | boolean_options: ClassVar[List[str]] 14 | def initialize_options(self) -> None: ... 15 | def finalize_options(self) -> None: ... 16 | @abstractmethod 17 | def run(self) -> None: ... 18 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/cygwinccompiler.pyi: -------------------------------------------------------------------------------- 1 | from distutils.unixccompiler import UnixCCompiler 2 | 3 | class CygwinCCompiler(UnixCCompiler): ... 4 | class Mingw32CCompiler(CygwinCCompiler): ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/debug.pyi: -------------------------------------------------------------------------------- 1 | DEBUG: bool 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/dep_util.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, Tuple 2 | 3 | def newer(source: str, target: str) -> bool: ... 4 | def newer_pairwise(sources: List[str], targets: List[str]) -> List[Tuple[str, str]]: ... 5 | def newer_group(sources: List[str], target: str, missing: str = ...) -> bool: ... 6 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/dir_util.pyi: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | def mkpath(name: str, mode: int = ..., verbose: int = ..., dry_run: int = ...) -> List[str]: ... 4 | def create_tree(base_dir: str, files: List[str], mode: int = ..., verbose: int = ..., dry_run: int = ...) -> None: ... 5 | def copy_tree( 6 | src: str, 7 | dst: str, 8 | preserve_mode: int = ..., 9 | preserve_times: int = ..., 10 | preserve_symlinks: int = ..., 11 | update: int = ..., 12 | verbose: int = ..., 13 | dry_run: int = ..., 14 | ) -> List[str]: ... 15 | def remove_tree(directory: str, verbose: int = ..., dry_run: int = ...) -> None: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/dist.pyi: -------------------------------------------------------------------------------- 1 | from distutils.cmd import Command 2 | from typing import Any, Dict, Iterable, Mapping, Optional, Text, Tuple, Type 3 | 4 | class Distribution: 5 | cmdclass: Dict[str, Type[Command]] 6 | def __init__(self, attrs: Optional[Mapping[str, Any]] = ...) -> None: ... 7 | def get_option_dict(self, command: str) -> Dict[str, Tuple[str, Text]]: ... 8 | def parse_config_files(self, filenames: Optional[Iterable[Text]] = ...) -> None: ... 9 | def get_command_obj(self, command: str, create: bool = ...) -> Optional[Command]: ... 10 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/emxccompiler.pyi: -------------------------------------------------------------------------------- 1 | from distutils.unixccompiler import UnixCCompiler 2 | 3 | class EMXCCompiler(UnixCCompiler): ... 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/extension.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, Optional, Tuple 2 | 3 | class Extension: 4 | def __init__( 5 | self, 6 | name: str, 7 | sources: List[str], 8 | include_dirs: List[str] = ..., 9 | define_macros: List[Tuple[str, Optional[str]]] = ..., 10 | undef_macros: List[str] = ..., 11 | library_dirs: List[str] = ..., 12 | libraries: List[str] = ..., 13 | runtime_library_dirs: List[str] = ..., 14 | extra_objects: List[str] = ..., 15 | extra_compile_args: List[str] = ..., 16 | extra_link_args: List[str] = ..., 17 | export_symbols: List[str] = ..., 18 | swig_opts: Optional[str] = ..., # undocumented 19 | depends: List[str] = ..., 20 | language: str = ..., 21 | ) -> None: ... 22 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/file_util.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional, Sequence, Tuple 2 | 3 | def copy_file( 4 | src: str, 5 | dst: str, 6 | preserve_mode: bool = ..., 7 | preserve_times: bool = ..., 8 | update: bool = ..., 9 | link: Optional[str] = ..., 10 | verbose: bool = ..., 11 | dry_run: bool = ..., 12 | ) -> Tuple[str, str]: ... 13 | def move_file(src: str, dst: str, verbose: bool = ..., dry_run: bool = ...) -> str: ... 14 | def write_file(filename: str, contents: Sequence[str]) -> None: ... 15 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/filelist.pyi: -------------------------------------------------------------------------------- 1 | class FileList: ... 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/msvccompiler.pyi: -------------------------------------------------------------------------------- 1 | from distutils.ccompiler import CCompiler 2 | 3 | class MSVCCompiler(CCompiler): ... 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/spawn.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | def spawn(cmd: List[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ...) -> None: ... 4 | def find_executable(executable: str, path: Optional[str] = ...) -> Optional[str]: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/sysconfig.pyi: -------------------------------------------------------------------------------- 1 | from distutils.ccompiler import CCompiler 2 | from typing import Mapping, Optional, Union 3 | 4 | PREFIX: str 5 | EXEC_PREFIX: str 6 | 7 | def get_config_var(name: str) -> Union[int, str, None]: ... 8 | def get_config_vars(*args: str) -> Mapping[str, Union[int, str]]: ... 9 | def get_config_h_filename() -> str: ... 10 | def get_makefile_filename() -> str: ... 11 | def get_python_inc(plat_specific: bool = ..., prefix: Optional[str] = ...) -> str: ... 12 | def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., prefix: Optional[str] = ...) -> str: ... 13 | def customize_compiler(compiler: CCompiler) -> None: ... 14 | def set_python_build() -> None: ... 15 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/text_file.pyi: -------------------------------------------------------------------------------- 1 | from typing import IO, List, Optional, Tuple, Union 2 | 3 | class TextFile: 4 | def __init__( 5 | self, 6 | filename: Optional[str] = ..., 7 | file: Optional[IO[str]] = ..., 8 | *, 9 | strip_comments: bool = ..., 10 | lstrip_ws: bool = ..., 11 | rstrip_ws: bool = ..., 12 | skip_blanks: bool = ..., 13 | join_lines: bool = ..., 14 | collapse_join: bool = ..., 15 | ) -> None: ... 16 | def open(self, filename: str) -> None: ... 17 | def close(self) -> None: ... 18 | def warn(self, msg: str, line: Union[List[int], Tuple[int, int], int] = ...) -> None: ... 19 | def readline(self) -> Optional[str]: ... 20 | def readlines(self) -> List[str]: ... 21 | def unreadline(self, line: str) -> str: ... 22 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/distutils/unixccompiler.pyi: -------------------------------------------------------------------------------- 1 | from distutils.ccompiler import CCompiler 2 | 3 | class UnixCCompiler(CCompiler): ... 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/MIMEText.pyi: -------------------------------------------------------------------------------- 1 | from email.mime.nonmultipart import MIMENonMultipart 2 | 3 | class MIMEText(MIMENonMultipart): 4 | def __init__(self, _text, _subtype=..., _charset=...) -> None: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/__init__.pyi: -------------------------------------------------------------------------------- 1 | from typing import IO, Any, AnyStr 2 | 3 | def message_from_string(s: AnyStr, *args, **kwargs): ... 4 | def message_from_bytes(s: str, *args, **kwargs): ... 5 | def message_from_file(fp: IO[AnyStr], *args, **kwargs): ... 6 | def message_from_binary_file(fp: IO[str], *args, **kwargs): ... 7 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/base64mime.pyi: -------------------------------------------------------------------------------- 1 | def base64_len(s: bytes) -> int: ... 2 | def header_encode(header, charset=..., keep_eols=..., maxlinelen=..., eol=...): ... 3 | def encode(s, binary=..., maxlinelen=..., eol=...): ... 4 | 5 | body_encode = encode 6 | encodestring = encode 7 | 8 | def decode(s, convert_eols=...): ... 9 | 10 | body_decode = decode 11 | decodestring = decode 12 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/encoders.pyi: -------------------------------------------------------------------------------- 1 | def encode_base64(msg) -> None: ... 2 | def encode_quopri(msg) -> None: ... 3 | def encode_7or8bit(msg) -> None: ... 4 | def encode_noop(msg) -> None: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/feedparser.pyi: -------------------------------------------------------------------------------- 1 | class BufferedSubFile: 2 | def __init__(self) -> None: ... 3 | def push_eof_matcher(self, pred) -> None: ... 4 | def pop_eof_matcher(self): ... 5 | def close(self) -> None: ... 6 | def readline(self): ... 7 | def unreadline(self, line) -> None: ... 8 | def push(self, data): ... 9 | def pushlines(self, lines) -> None: ... 10 | def is_closed(self): ... 11 | def __iter__(self): ... 12 | def next(self): ... 13 | 14 | class FeedParser: 15 | def __init__(self, _factory=...) -> None: ... 16 | def feed(self, data) -> None: ... 17 | def close(self): ... 18 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/generator.pyi: -------------------------------------------------------------------------------- 1 | class Generator: 2 | def __init__(self, outfp, mangle_from_: bool = ..., maxheaderlen: int = ...) -> None: ... 3 | def write(self, s) -> None: ... 4 | def flatten(self, msg, unixfrom: bool = ...) -> None: ... 5 | def clone(self, fp): ... 6 | 7 | class DecodedGenerator(Generator): 8 | def __init__(self, outfp, mangle_from_: bool = ..., maxheaderlen: int = ..., fmt=...) -> None: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/header.pyi: -------------------------------------------------------------------------------- 1 | def decode_header(header): ... 2 | def make_header(decoded_seq, maxlinelen=..., header_name=..., continuation_ws=...): ... 3 | 4 | class Header: 5 | def __init__(self, s=..., charset=..., maxlinelen=..., header_name=..., continuation_ws=..., errors=...) -> None: ... 6 | def __unicode__(self): ... 7 | def __eq__(self, other): ... 8 | def __ne__(self, other): ... 9 | def append(self, s, charset=..., errors=...) -> None: ... 10 | def encode(self, splitchars=...): ... 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/iterators.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Generator 2 | 3 | def walk(self) -> Generator[Any, Any, Any]: ... 4 | def body_line_iterator(msg, decode: bool = ...) -> Generator[Any, Any, Any]: ... 5 | def typed_subpart_iterator(msg, maintype=..., subtype=...) -> Generator[Any, Any, Any]: ... 6 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/mime/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/@python2/email/mime/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/mime/application.pyi: -------------------------------------------------------------------------------- 1 | from email.mime.nonmultipart import MIMENonMultipart 2 | from typing import Callable, Optional, Tuple, Union 3 | 4 | _ParamsType = Union[str, None, Tuple[str, Optional[str], str]] 5 | 6 | class MIMEApplication(MIMENonMultipart): 7 | def __init__( 8 | self, _data: bytes, _subtype: str = ..., _encoder: Callable[[MIMEApplication], None] = ..., **_params: _ParamsType 9 | ) -> None: ... 10 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/mime/audio.pyi: -------------------------------------------------------------------------------- 1 | from email.mime.nonmultipart import MIMENonMultipart 2 | 3 | class MIMEAudio(MIMENonMultipart): 4 | def __init__(self, _audiodata, _subtype=..., _encoder=..., **_params) -> None: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/mime/base.pyi: -------------------------------------------------------------------------------- 1 | from email import message 2 | 3 | class MIMEBase(message.Message): 4 | def __init__(self, _maintype, _subtype, **_params) -> None: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/mime/image.pyi: -------------------------------------------------------------------------------- 1 | from email.mime.nonmultipart import MIMENonMultipart 2 | 3 | class MIMEImage(MIMENonMultipart): 4 | def __init__(self, _imagedata, _subtype=..., _encoder=..., **_params) -> None: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/mime/message.pyi: -------------------------------------------------------------------------------- 1 | from email.mime.nonmultipart import MIMENonMultipart 2 | 3 | class MIMEMessage(MIMENonMultipart): 4 | def __init__(self, _msg, _subtype=...) -> None: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/mime/multipart.pyi: -------------------------------------------------------------------------------- 1 | from email.mime.base import MIMEBase 2 | 3 | class MIMEMultipart(MIMEBase): 4 | def __init__(self, _subtype=..., boundary=..., _subparts=..., **_params) -> None: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/mime/nonmultipart.pyi: -------------------------------------------------------------------------------- 1 | from email.mime.base import MIMEBase 2 | 3 | class MIMENonMultipart(MIMEBase): 4 | def attach(self, payload): ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/mime/text.pyi: -------------------------------------------------------------------------------- 1 | from email.mime.nonmultipart import MIMENonMultipart 2 | 3 | class MIMEText(MIMENonMultipart): 4 | def __init__(self, _text, _subtype=..., _charset=...) -> None: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/parser.pyi: -------------------------------------------------------------------------------- 1 | from .feedparser import FeedParser as FeedParser # not in __all__ but listed in documentation 2 | 3 | class Parser: 4 | def __init__(self, *args, **kws) -> None: ... 5 | def parse(self, fp, headersonly: bool = ...): ... 6 | def parsestr(self, text, headersonly: bool = ...): ... 7 | 8 | class HeaderParser(Parser): 9 | def parse(self, fp, headersonly: bool = ...): ... 10 | def parsestr(self, text, headersonly: bool = ...): ... 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/email/quoprimime.pyi: -------------------------------------------------------------------------------- 1 | def header_quopri_check(c): ... 2 | def body_quopri_check(c): ... 3 | def header_quopri_len(s): ... 4 | def body_quopri_len(str): ... 5 | def unquote(s): ... 6 | def quote(c): ... 7 | def header_encode(header, charset: str = ..., keep_eols: bool = ..., maxlinelen: int = ..., eol=...): ... 8 | def encode(body, binary: bool = ..., maxlinelen: int = ..., eol=...): ... 9 | 10 | body_encode = encode 11 | encodestring = encode 12 | 13 | def decode(encoded, eol=...): ... 14 | 15 | body_decode = decode 16 | decodestring = decode 17 | 18 | def header_decode(s): ... 19 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/encodings/__init__.pyi: -------------------------------------------------------------------------------- 1 | import codecs 2 | from typing import Any 3 | 4 | def search_function(encoding: str) -> codecs.CodecInfo: ... 5 | 6 | # Explicitly mark this package as incomplete. 7 | def __getattr__(name: str) -> Any: ... 8 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/encodings/utf_8.pyi: -------------------------------------------------------------------------------- 1 | import codecs 2 | from typing import Text, Tuple 3 | 4 | class IncrementalEncoder(codecs.IncrementalEncoder): 5 | def encode(self, input: Text, final: bool = ...) -> bytes: ... 6 | 7 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 8 | def _buffer_decode(self, input: bytes, errors: str, final: bool) -> Tuple[Text, int]: ... 9 | 10 | class StreamWriter(codecs.StreamWriter): ... 11 | class StreamReader(codecs.StreamReader): ... 12 | 13 | def getregentry() -> codecs.CodecInfo: ... 14 | def encode(input: Text, errors: Text = ...) -> bytes: ... 15 | def decode(input: bytes, errors: Text = ...) -> Text: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/fnmatch.pyi: -------------------------------------------------------------------------------- 1 | from typing import AnyStr, Iterable, List, Union 2 | 3 | _EitherStr = Union[str, unicode] 4 | 5 | def fnmatch(filename: _EitherStr, pattern: _EitherStr) -> bool: ... 6 | def fnmatchcase(filename: _EitherStr, pattern: _EitherStr) -> bool: ... 7 | def filter(names: Iterable[AnyStr], pattern: _EitherStr) -> List[AnyStr]: ... 8 | def translate(pattern: AnyStr) -> AnyStr: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/future_builtins.pyi: -------------------------------------------------------------------------------- 1 | from itertools import ifilter, imap, izip 2 | from typing import Any 3 | 4 | filter = ifilter 5 | map = imap 6 | zip = izip 7 | 8 | def ascii(obj: Any) -> str: ... 9 | def hex(x: int) -> str: ... 10 | def oct(x: int) -> str: ... 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/getopt.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, Tuple 2 | 3 | class GetoptError(Exception): 4 | opt: str 5 | msg: str 6 | def __init__(self, msg: str, opt: str = ...) -> None: ... 7 | def __str__(self) -> str: ... 8 | 9 | error = GetoptError 10 | 11 | def getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... 12 | def gnu_getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... 13 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/getpass.pyi: -------------------------------------------------------------------------------- 1 | from typing import IO, Any 2 | 3 | class GetPassWarning(UserWarning): ... 4 | 5 | def getpass(prompt: str = ..., stream: IO[Any] = ...) -> str: ... 6 | def getuser() -> str: ... 7 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/glob.pyi: -------------------------------------------------------------------------------- 1 | from typing import AnyStr, Iterator, List, Union 2 | 3 | def glob(pathname: AnyStr) -> List[AnyStr]: ... 4 | def iglob(pathname: AnyStr) -> Iterator[AnyStr]: ... 5 | def glob1(dirname: Union[str, unicode], pattern: AnyStr) -> List[AnyStr]: ... 6 | def glob0(dirname: Union[str, unicode], basename: AnyStr) -> List[AnyStr]: ... 7 | def has_magic(s: Union[str, unicode]) -> bool: ... # undocumented 8 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/heapq.pyi: -------------------------------------------------------------------------------- 1 | from _typeshed import SupportsLessThan 2 | from typing import Any, Callable, Iterable, List, Optional, Protocol, TypeVar 3 | 4 | _T = TypeVar("_T") 5 | 6 | def cmp_lt(x, y) -> bool: ... 7 | def heappush(heap: List[_T], item: _T) -> None: ... 8 | def heappop(heap: List[_T]) -> _T: ... 9 | def heappushpop(heap: List[_T], item: _T) -> _T: ... 10 | def heapify(x: List[_T]) -> None: ... 11 | def heapreplace(heap: List[_T], item: _T) -> _T: ... 12 | def merge(*iterables: Iterable[_T]) -> Iterable[_T]: ... 13 | def nlargest(n: int, iterable: Iterable[_T], key: Optional[Callable[[_T], SupportsLessThan]] = ...) -> List[_T]: ... 14 | def nsmallest(n: int, iterable: Iterable[_T], key: Optional[Callable[[_T], SupportsLessThan]] = ...) -> List[_T]: ... 15 | def _heapify_max(__x: List[_T]) -> None: ... # undocumented 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/htmlentitydefs.pyi: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | name2codepoint: Dict[str, int] 4 | codepoint2name: Dict[int, str] 5 | entitydefs: Dict[str, str] 6 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/importlib.pyi: -------------------------------------------------------------------------------- 1 | import types 2 | from typing import Optional, Text 3 | 4 | def import_module(name: Text, package: Optional[Text] = ...) -> types.ModuleType: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/markupbase.pyi: -------------------------------------------------------------------------------- 1 | from typing import Tuple 2 | 3 | class ParserBase(object): 4 | def __init__(self) -> None: ... 5 | def error(self, message: str) -> None: ... 6 | def reset(self) -> None: ... 7 | def getpos(self) -> Tuple[int, int]: ... 8 | def unknown_decl(self, data: str) -> None: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/md5.pyi: -------------------------------------------------------------------------------- 1 | from hashlib import md5 as md5 2 | 3 | new = md5 4 | blocksize: int 5 | digest_size: int 6 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/mimetools.pyi: -------------------------------------------------------------------------------- 1 | import rfc822 2 | from typing import Any 3 | 4 | class Message(rfc822.Message): 5 | encodingheader: Any 6 | typeheader: Any 7 | def __init__(self, fp, seekable: int = ...): ... 8 | plisttext: Any 9 | type: Any 10 | maintype: Any 11 | subtype: Any 12 | def parsetype(self): ... 13 | plist: Any 14 | def parseplist(self): ... 15 | def getplist(self): ... 16 | def getparam(self, name): ... 17 | def getparamnames(self): ... 18 | def getencoding(self): ... 19 | def gettype(self): ... 20 | def getmaintype(self): ... 21 | def getsubtype(self): ... 22 | 23 | def choose_boundary(): ... 24 | def decode(input, output, encoding): ... 25 | def encode(input, output, encoding): ... 26 | def copyliteral(input, output): ... 27 | def copybinary(input, output): ... 28 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/multiprocessing/dummy/connection.pyi: -------------------------------------------------------------------------------- 1 | from Queue import Queue 2 | from typing import Any, List, Optional, Tuple, Type 3 | 4 | families: List[None] 5 | 6 | class Connection(object): 7 | _in: Any 8 | _out: Any 9 | recv: Any 10 | recv_bytes: Any 11 | send: Any 12 | send_bytes: Any 13 | def __init__(self, _in, _out) -> None: ... 14 | def close(self) -> None: ... 15 | def poll(self, timeout=...) -> Any: ... 16 | 17 | class Listener(object): 18 | _backlog_queue: Optional[Queue[Any]] 19 | address: Any 20 | def __init__(self, address=..., family=..., backlog=...) -> None: ... 21 | def accept(self) -> Connection: ... 22 | def close(self) -> None: ... 23 | 24 | def Client(address) -> Connection: ... 25 | def Pipe(duplex=...) -> Tuple[Connection, Connection]: ... 26 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/mutex.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Callable, Deque, TypeVar 2 | 3 | _T = TypeVar("_T") 4 | 5 | class mutex: 6 | locked: bool 7 | queue: Deque[Any] 8 | def __init__(self) -> None: ... 9 | def test(self) -> bool: ... 10 | def testandset(self) -> bool: ... 11 | def lock(self, function: Callable[[_T], Any], argument: _T) -> None: ... 12 | def unlock(self) -> None: ... 13 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/nturl2path.pyi: -------------------------------------------------------------------------------- 1 | from typing import AnyStr 2 | 3 | def url2pathname(url: AnyStr) -> AnyStr: ... 4 | def pathname2url(p: AnyStr) -> AnyStr: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/pipes.pyi: -------------------------------------------------------------------------------- 1 | from typing import IO, Any, AnyStr 2 | 3 | class Template: 4 | def __init__(self) -> None: ... 5 | def reset(self) -> None: ... 6 | def clone(self) -> Template: ... 7 | def debug(self, flag: bool) -> None: ... 8 | def append(self, cmd: str, kind: str) -> None: ... 9 | def prepend(self, cmd: str, kind: str) -> None: ... 10 | def open(self, file: str, mode: str) -> IO[Any]: ... 11 | def copy(self, infile: str, outfile: str) -> None: ... 12 | 13 | def quote(s: AnyStr) -> AnyStr: ... 14 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/robotparser.pyi: -------------------------------------------------------------------------------- 1 | class RobotFileParser: 2 | def set_url(self, url: str): ... 3 | def read(self): ... 4 | def parse(self, lines: str): ... 5 | def can_fetch(self, user_agent: str, url: str): ... 6 | def mtime(self): ... 7 | def modified(self): ... 8 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/runpy.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Optional 2 | 3 | class _TempModule: 4 | mod_name: Any 5 | module: Any 6 | def __init__(self, mod_name): ... 7 | def __enter__(self): ... 8 | def __exit__(self, *args): ... 9 | 10 | class _ModifiedArgv0: 11 | value: Any 12 | def __init__(self, value): ... 13 | def __enter__(self): ... 14 | def __exit__(self, *args): ... 15 | 16 | def run_module(mod_name, init_globals: Optional[Any] = ..., run_name: Optional[Any] = ..., alter_sys: bool = ...): ... 17 | def run_path(path_name, init_globals: Optional[Any] = ..., run_name: Optional[Any] = ...): ... 18 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/sha.pyi: -------------------------------------------------------------------------------- 1 | class sha(object): 2 | def update(self, arg: str) -> None: ... 3 | def digest(self) -> str: ... 4 | def hexdigest(self) -> str: ... 5 | def copy(self) -> sha: ... 6 | 7 | def new(string: str = ...) -> sha: ... 8 | 9 | blocksize: int 10 | digest_size: int 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/spwd.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, NamedTuple 2 | 3 | class struct_spwd(NamedTuple): 4 | sp_nam: str 5 | sp_pwd: str 6 | sp_lstchg: int 7 | sp_min: int 8 | sp_max: int 9 | sp_warn: int 10 | sp_inact: int 11 | sp_expire: int 12 | sp_flag: int 13 | 14 | def getspall() -> List[struct_spwd]: ... 15 | def getspnam(name: str) -> struct_spwd: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/toaiff.pyi: -------------------------------------------------------------------------------- 1 | from pipes import Template 2 | from typing import Dict, List 3 | 4 | table: Dict[str, Template] 5 | t: Template 6 | uncompress: Template 7 | 8 | class error(Exception): ... 9 | 10 | def toaiff(filename: str) -> str: ... 11 | def _toaiff(filename: str, temps: List[str]) -> str: ... 12 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/user.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | def __getattr__(name) -> Any: ... 4 | 5 | home: str 6 | pythonrc: str 7 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/@python2/whichdb.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional, Text 2 | 3 | def whichdb(filename: Text) -> Optional[str]: ... 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/__future__.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import List 3 | 4 | class _Feature: 5 | def getOptionalRelease(self) -> sys._version_info: ... 6 | def getMandatoryRelease(self) -> sys._version_info: ... 7 | compiler_flag: int 8 | 9 | absolute_import: _Feature 10 | division: _Feature 11 | generators: _Feature 12 | nested_scopes: _Feature 13 | print_function: _Feature 14 | unicode_literals: _Feature 15 | with_statement: _Feature 16 | if sys.version_info >= (3, 0): 17 | barry_as_FLUFL: _Feature 18 | 19 | if sys.version_info >= (3, 5): 20 | generator_stop: _Feature 21 | 22 | if sys.version_info >= (3, 7): 23 | annotations: _Feature 24 | 25 | all_feature_names: List[str] # undocumented 26 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_bisect.pyi: -------------------------------------------------------------------------------- 1 | from typing import MutableSequence, Optional, Sequence, TypeVar 2 | 3 | _T = TypeVar("_T") 4 | 5 | def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> int: ... 6 | def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> int: ... 7 | def insort_left(a: MutableSequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> None: ... 8 | def insort_right(a: MutableSequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> None: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_bootlocale.pyi: -------------------------------------------------------------------------------- 1 | def getpreferredencoding(do_setlocale: bool = ...) -> str: ... 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_compat_pickle.pyi: -------------------------------------------------------------------------------- 1 | from typing import Dict, Tuple 2 | 3 | IMPORT_MAPPING: Dict[str, str] 4 | NAME_MAPPING: Dict[Tuple[str, str], Tuple[str, str]] 5 | PYTHON2_EXCEPTIONS: Tuple[str, ...] 6 | MULTIPROCESSING_EXCEPTIONS: Tuple[str, ...] 7 | REVERSE_IMPORT_MAPPING: Dict[str, str] 8 | REVERSE_NAME_MAPPING: Dict[Tuple[str, str], Tuple[str, str]] 9 | PYTHON3_OSERROR_EXCEPTIONS: Tuple[str, ...] 10 | PYTHON3_IMPORTERROR_EXCEPTIONS: Tuple[str, ...] 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_decimal.pyi: -------------------------------------------------------------------------------- 1 | from decimal import * 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_heapq.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Any, Callable, Iterable, List, Optional, TypeVar 3 | 4 | _T = TypeVar("_T") 5 | 6 | def heapify(__heap: List[_T]) -> None: ... 7 | def heappop(__heap: List[_T]) -> _T: ... 8 | def heappush(__heap: List[_T], __item: _T) -> None: ... 9 | def heappushpop(__heap: List[_T], __item: _T) -> _T: ... 10 | def heapreplace(__heap: List[_T], __item: _T) -> _T: ... 11 | 12 | if sys.version_info < (3,): 13 | def nlargest(__n: int, __iterable: Iterable[_T], __key: Optional[Callable[[_T], Any]] = ...) -> List[_T]: ... 14 | def nsmallest(__n: int, __iterable: Iterable[_T], __key: Optional[Callable[[_T], Any]] = ...) -> List[_T]: ... 15 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_imp.pyi: -------------------------------------------------------------------------------- 1 | import types 2 | from importlib.machinery import ModuleSpec 3 | from typing import Any, List 4 | 5 | def create_builtin(__spec: ModuleSpec) -> types.ModuleType: ... 6 | def create_dynamic(__spec: ModuleSpec, __file: Any = ...) -> None: ... 7 | def acquire_lock() -> None: ... 8 | def exec_builtin(__mod: types.ModuleType) -> int: ... 9 | def exec_dynamic(__mod: types.ModuleType) -> int: ... 10 | def extension_suffixes() -> List[str]: ... 11 | def get_frozen_object(__name: str) -> types.CodeType: ... 12 | def init_frozen(__name: str) -> types.ModuleType: ... 13 | def is_builtin(__name: str) -> int: ... 14 | def is_frozen(__name: str) -> bool: ... 15 | def is_frozen_package(__name: str) -> bool: ... 16 | def lock_held() -> bool: ... 17 | def release_lock() -> None: ... 18 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_markupbase.pyi: -------------------------------------------------------------------------------- 1 | from typing import Tuple 2 | 3 | class ParserBase: 4 | def __init__(self) -> None: ... 5 | def error(self, message: str) -> None: ... 6 | def reset(self) -> None: ... 7 | def getpos(self) -> Tuple[int, int]: ... 8 | def unknown_decl(self, data: str) -> None: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_posixsubprocess.pyi: -------------------------------------------------------------------------------- 1 | # NOTE: These are incomplete! 2 | 3 | from typing import Callable, Sequence, Tuple 4 | 5 | def cloexec_pipe() -> Tuple[int, int]: ... 6 | def fork_exec( 7 | args: Sequence[str], 8 | executable_list: Sequence[bytes], 9 | close_fds: bool, 10 | fds_to_keep: Sequence[int], 11 | cwd: str, 12 | env_list: Sequence[bytes], 13 | p2cread: int, 14 | p2cwrite: int, 15 | c2pred: int, 16 | c2pwrite: int, 17 | errread: int, 18 | errwrite: int, 19 | errpipe_read: int, 20 | errpipe_write: int, 21 | restore_signals: int, 22 | start_new_session: int, 23 | preexec_fn: Callable[[], None], 24 | ) -> int: ... 25 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_py_abc.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, Tuple, Type, TypeVar 2 | 3 | _T = TypeVar("_T") 4 | 5 | # TODO: Change the return into a NewType bound to int after pytype/#597 6 | def get_cache_token() -> object: ... 7 | 8 | class ABCMeta(type): 9 | def __new__(__mcls, __name: str, __bases: Tuple[Type[Any], ...], __namespace: Dict[str, Any]) -> ABCMeta: ... 10 | def register(cls, subclass: Type[_T]) -> Type[_T]: ... 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_pydecimal.pyi: -------------------------------------------------------------------------------- 1 | # This is a slight lie, the implementations aren't exactly identical 2 | # However, in all likelihood, the differences are inconsequential 3 | from decimal import * 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_random.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Tuple 3 | 4 | # Actually Tuple[(int,) * 625] 5 | _State = Tuple[int, ...] 6 | 7 | class Random(object): 8 | def __init__(self, seed: object = ...) -> None: ... 9 | def seed(self, __n: object = ...) -> None: ... 10 | def getstate(self) -> _State: ... 11 | def setstate(self, __state: _State) -> None: ... 12 | def random(self) -> float: ... 13 | def getrandbits(self, __k: int) -> int: ... 14 | if sys.version_info < (3,): 15 | def jumpahead(self, i: int) -> None: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_sitebuiltins.pyi: -------------------------------------------------------------------------------- 1 | from typing import ClassVar, Iterable, NoReturn, Optional 2 | from typing_extensions import Literal 3 | 4 | class Quitter: 5 | name: str 6 | eof: str 7 | def __init__(self, name: str, eof: str) -> None: ... 8 | def __call__(self, code: Optional[int] = ...) -> NoReturn: ... 9 | 10 | class _Printer: 11 | MAXLINES: ClassVar[Literal[23]] 12 | def __init__(self, name: str, data: str, files: Iterable[str] = ..., dirs: Iterable[str] = ...) -> None: ... 13 | def __call__(self) -> None: ... 14 | 15 | class _Helper: 16 | def __call__(self, request: object) -> None: ... 17 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_threading_local.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, Tuple 2 | from weakref import ReferenceType 3 | 4 | localdict = Dict[Any, Any] 5 | 6 | class _localimpl: 7 | key: str 8 | dicts: Dict[int, Tuple[ReferenceType[Any], localdict]] 9 | def __init__(self) -> None: ... 10 | def get_dict(self) -> localdict: ... 11 | def create_dict(self) -> localdict: ... 12 | 13 | class local: 14 | def __getattribute__(self, name: str) -> Any: ... 15 | def __setattr__(self, name: str, value: Any) -> None: ... 16 | def __delattr__(self, name: str) -> None: ... 17 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_tracemalloc.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from tracemalloc import _FrameTupleT, _TraceTupleT 3 | from typing import Optional, Sequence, Tuple 4 | 5 | def _get_object_traceback(__obj: object) -> Optional[Sequence[_FrameTupleT]]: ... 6 | def _get_traces() -> Sequence[_TraceTupleT]: ... 7 | def clear_traces() -> None: ... 8 | def get_traceback_limit() -> int: ... 9 | def get_traced_memory() -> Tuple[int, int]: ... 10 | def get_tracemalloc_memory() -> int: ... 11 | def is_tracing() -> bool: ... 12 | 13 | if sys.version_info >= (3, 9): 14 | def reset_peak() -> None: ... 15 | 16 | def start(__nframe: int = ...) -> None: ... 17 | def stop() -> None: ... 18 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/_typeshed/xml.pyi: -------------------------------------------------------------------------------- 1 | # Stub-only types. This module does not exist at runtime. 2 | 3 | from typing import Any, Optional 4 | from typing_extensions import Protocol 5 | 6 | # As defined https://docs.python.org/3/library/xml.dom.html#domimplementation-objects 7 | class DOMImplementation(Protocol): 8 | def hasFeature(self, feature: str, version: Optional[str]) -> bool: ... 9 | def createDocument(self, namespaceUri: str, qualifiedName: str, doctype: Optional[Any]) -> Any: ... 10 | def createDocumentType(self, qualifiedName: str, publicId: str, systemId: str) -> Any: ... 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/abc.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Callable, Type, TypeVar 2 | 3 | _T = TypeVar("_T") 4 | _FuncT = TypeVar("_FuncT", bound=Callable[..., Any]) 5 | 6 | # These definitions have special processing in mypy 7 | class ABCMeta(type): 8 | def register(cls: ABCMeta, subclass: Type[_T]) -> Type[_T]: ... 9 | 10 | def abstractmethod(callable: _FuncT) -> _FuncT: ... 11 | 12 | class abstractproperty(property): ... 13 | 14 | # These two are deprecated and not supported by mypy 15 | def abstractstaticmethod(callable: _FuncT) -> _FuncT: ... 16 | def abstractclassmethod(callable: _FuncT) -> _FuncT: ... 17 | 18 | class ABC(metaclass=ABCMeta): ... 19 | 20 | def get_cache_token() -> object: ... 21 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/antigravity.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | if sys.version_info >= (3, 0): 4 | def geohash(latitude: float, longitude: float, datedow: bytes) -> None: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/asyncio/base_tasks.pyi: -------------------------------------------------------------------------------- 1 | from _typeshed import AnyPath 2 | from types import FrameType 3 | from typing import Any, List, Optional 4 | 5 | from . import tasks 6 | 7 | def _task_repr_info(task: tasks.Task[Any]) -> List[str]: ... # undocumented 8 | def _task_get_stack(task: tasks.Task[Any], limit: Optional[int]) -> List[FrameType]: ... # undocumented 9 | def _task_print_stack(task: tasks.Task[Any], limit: Optional[int], file: AnyPath) -> None: ... # undocumented 10 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/asyncio/compat.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import List 3 | 4 | if sys.version_info < (3, 7): 5 | PY34: bool 6 | PY35: bool 7 | PY352: bool 8 | def flatten_list_bytes(list_of_data: List[bytes]) -> bytes: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/asyncio/constants.pyi: -------------------------------------------------------------------------------- 1 | import enum 2 | import sys 3 | 4 | LOG_THRESHOLD_FOR_CONNLOST_WRITES: int 5 | ACCEPT_RETRY_DELAY: int 6 | DEBUG_STACK_DEPTH: int 7 | if sys.version_info >= (3, 7): 8 | SSL_HANDSHAKE_TIMEOUT: float 9 | SENDFILE_FALLBACK_READBUFFER_SIZE: int 10 | 11 | class _SendfileMode(enum.Enum): 12 | UNSUPPORTED: int = ... 13 | TRY_NATIVE: int = ... 14 | FALLBACK: int = ... 15 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/asyncio/coroutines.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Callable, TypeVar 2 | 3 | _F = TypeVar("_F", bound=Callable[..., Any]) 4 | 5 | def coroutine(func: _F) -> _F: ... 6 | def iscoroutinefunction(func: Callable[..., Any]) -> bool: ... 7 | def iscoroutine(obj: Any) -> bool: ... 8 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/asyncio/exceptions.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Optional 3 | 4 | if sys.version_info >= (3, 8): 5 | class CancelledError(BaseException): ... 6 | class TimeoutError(Exception): ... 7 | class InvalidStateError(Exception): ... 8 | class SendfileNotAvailableError(RuntimeError): ... 9 | class IncompleteReadError(EOFError): 10 | expected: Optional[int] 11 | partial: bytes 12 | def __init__(self, partial: bytes, expected: Optional[int]) -> None: ... 13 | class LimitOverrunError(Exception): 14 | consumed: int 15 | def __init__(self, message: str, consumed: int) -> None: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/asyncio/log.pyi: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger: logging.Logger 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/asyncio/runners.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | if sys.version_info >= (3, 7): 4 | from typing import Awaitable, Optional, TypeVar 5 | 6 | _T = TypeVar("_T") 7 | if sys.version_info >= (3, 8): 8 | def run(main: Awaitable[_T], *, debug: Optional[bool] = ...) -> _T: ... 9 | else: 10 | def run(main: Awaitable[_T], *, debug: bool = ...) -> _T: ... 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/asyncio/selector_events.pyi: -------------------------------------------------------------------------------- 1 | import selectors 2 | from typing import Optional 3 | 4 | from . import base_events 5 | 6 | class BaseSelectorEventLoop(base_events.BaseEventLoop): 7 | def __init__(self, selector: Optional[selectors.BaseSelector] = ...) -> None: ... 8 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/asyncio/staggered.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Any, Awaitable, Callable, Iterable, List, Optional, Tuple 3 | 4 | from . import events 5 | 6 | if sys.version_info >= (3, 8): 7 | async def staggered_race( 8 | coro_fns: Iterable[Callable[[], Awaitable[Any]]], 9 | delay: Optional[float], 10 | *, 11 | loop: Optional[events.AbstractEventLoop] = ..., 12 | ) -> Tuple[Any, Optional[int], List[Optional[Exception]]]: ... 13 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/asyncio/threads.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Any, Callable, TypeVar 3 | 4 | _T = TypeVar("_T") 5 | 6 | if sys.version_info >= (3, 9): 7 | async def to_thread(__func: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ... 8 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/atexit.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Callable 2 | 3 | def _clear() -> None: ... 4 | def _ncallbacks() -> int: ... 5 | def _run_exitfuncs() -> None: ... 6 | def register(func: Callable[..., Any], *args: Any, **kwargs: Any) -> Callable[..., Any]: ... 7 | def unregister(func: Callable[..., Any]) -> None: ... 8 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/bisect.pyi: -------------------------------------------------------------------------------- 1 | from _bisect import * 2 | 3 | bisect = bisect_right 4 | insort = insort_right 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/chunk.pyi: -------------------------------------------------------------------------------- 1 | from typing import IO 2 | 3 | class Chunk: 4 | closed: bool 5 | align: bool 6 | file: IO[bytes] 7 | chunkname: bytes 8 | chunksize: int 9 | size_read: int 10 | offset: int 11 | seekable: bool 12 | def __init__(self, file: IO[bytes], align: bool = ..., bigendian: bool = ..., inclheader: bool = ...) -> None: ... 13 | def getname(self) -> bytes: ... 14 | def getsize(self) -> int: ... 15 | def close(self) -> None: ... 16 | def isatty(self) -> bool: ... 17 | def seek(self, pos: int, whence: int = ...) -> None: ... 18 | def tell(self) -> int: ... 19 | def read(self, size: int = ...) -> bytes: ... 20 | def skip(self) -> None: ... 21 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/codeop.pyi: -------------------------------------------------------------------------------- 1 | from types import CodeType 2 | from typing import Optional 3 | 4 | def compile_command(source: str, filename: str = ..., symbol: str = ...) -> Optional[CodeType]: ... 5 | 6 | class Compile: 7 | flags: int 8 | def __init__(self) -> None: ... 9 | def __call__(self, source: str, filename: str, symbol: str) -> CodeType: ... 10 | 11 | class CommandCompiler: 12 | compiler: Compile 13 | def __init__(self) -> None: ... 14 | def __call__(self, source: str, filename: str = ..., symbol: str = ...) -> Optional[CodeType]: ... 15 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/colorsys.pyi: -------------------------------------------------------------------------------- 1 | from typing import Tuple 2 | 3 | def rgb_to_yiq(r: float, g: float, b: float) -> Tuple[float, float, float]: ... 4 | def yiq_to_rgb(y: float, i: float, q: float) -> Tuple[float, float, float]: ... 5 | def rgb_to_hls(r: float, g: float, b: float) -> Tuple[float, float, float]: ... 6 | def hls_to_rgb(h: float, l: float, s: float) -> Tuple[float, float, float]: ... 7 | def rgb_to_hsv(r: float, g: float, b: float) -> Tuple[float, float, float]: ... 8 | def hsv_to_rgb(h: float, s: float, v: float) -> Tuple[float, float, float]: ... 9 | 10 | # TODO undocumented 11 | ONE_SIXTH: float 12 | ONE_THIRD: float 13 | TWO_THIRD: float 14 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/concurrent/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/concurrent/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/concurrent/futures/__init__.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from ._base import ( 4 | ALL_COMPLETED as ALL_COMPLETED, 5 | FIRST_COMPLETED as FIRST_COMPLETED, 6 | FIRST_EXCEPTION as FIRST_EXCEPTION, 7 | CancelledError as CancelledError, 8 | Executor as Executor, 9 | Future as Future, 10 | TimeoutError as TimeoutError, 11 | as_completed as as_completed, 12 | wait as wait, 13 | ) 14 | from .process import ProcessPoolExecutor as ProcessPoolExecutor 15 | from .thread import ThreadPoolExecutor as ThreadPoolExecutor 16 | 17 | if sys.version_info >= (3, 8): 18 | from ._base import InvalidStateError as InvalidStateError 19 | if sys.version_info >= (3, 7): 20 | from ._base import BrokenExecutor as BrokenExecutor 21 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/copy.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, Optional, TypeVar 2 | 3 | _T = TypeVar("_T") 4 | 5 | # None in CPython but non-None in Jython 6 | PyStringMap: Any 7 | 8 | # Note: memo and _nil are internal kwargs. 9 | def deepcopy(x: _T, memo: Optional[Dict[int, Any]] = ..., _nil: Any = ...) -> _T: ... 10 | def copy(x: _T) -> _T: ... 11 | 12 | class Error(Exception): ... 13 | 14 | error = Error 15 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/copyreg.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Callable, Hashable, List, Optional, SupportsInt, Tuple, TypeVar, Union 2 | 3 | _TypeT = TypeVar("_TypeT", bound=type) 4 | _Reduce = Union[Tuple[Callable[..., _TypeT], Tuple[Any, ...]], Tuple[Callable[..., _TypeT], Tuple[Any, ...], Optional[Any]]] 5 | 6 | __all__: List[str] 7 | 8 | def pickle( 9 | ob_type: _TypeT, 10 | pickle_function: Callable[[_TypeT], Union[str, _Reduce[_TypeT]]], 11 | constructor_ob: Optional[Callable[[_Reduce[_TypeT]], _TypeT]] = ..., 12 | ) -> None: ... 13 | def constructor(object: Callable[[_Reduce[_TypeT]], _TypeT]) -> None: ... 14 | def add_extension(module: Hashable, name: Hashable, code: SupportsInt) -> None: ... 15 | def remove_extension(module: Hashable, name: Hashable, code: int) -> None: ... 16 | def clear_extension_cache() -> None: ... 17 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/crypt.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import List, Optional, Union 3 | 4 | if sys.version_info >= (3, 3): 5 | class _Method: ... 6 | METHOD_CRYPT: _Method 7 | METHOD_MD5: _Method 8 | METHOD_SHA256: _Method 9 | METHOD_SHA512: _Method 10 | if sys.version_info >= (3, 7): 11 | METHOD_BLOWFISH: _Method 12 | 13 | methods: List[_Method] 14 | 15 | if sys.version_info >= (3, 7): 16 | def mksalt(method: Optional[_Method] = ..., *, rounds: Optional[int] = ...) -> str: ... 17 | else: 18 | def mksalt(method: Optional[_Method] = ...) -> str: ... 19 | def crypt(word: str, salt: Optional[Union[str, _Method]] = ...) -> str: ... 20 | 21 | else: 22 | def crypt(word: str, salt: str) -> str: ... 23 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/ctypes/util.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Optional 3 | 4 | def find_library(name: str) -> Optional[str]: ... 5 | 6 | if sys.platform == "win32": 7 | def find_msvcrt() -> Optional[str]: ... 8 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/curses/__init__.pyi: -------------------------------------------------------------------------------- 1 | from _curses import * # noqa: F403 2 | from _curses import _CursesWindow as _CursesWindow 3 | from typing import Any, Callable, TypeVar 4 | 5 | _T = TypeVar("_T") 6 | 7 | # available after calling `curses.initscr()` 8 | LINES: int 9 | COLS: int 10 | 11 | # available after calling `curses.start_color()` 12 | COLORS: int 13 | COLOR_PAIRS: int 14 | 15 | def wrapper(__func: Callable[..., _T], *arg: Any, **kwds: Any) -> _T: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/curses/textpad.pyi: -------------------------------------------------------------------------------- 1 | from _curses import _CursesWindow 2 | from typing import Callable, Optional, Union 3 | 4 | def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> None: ... 5 | 6 | class Textbox: 7 | stripspaces: bool 8 | def __init__(self, win: _CursesWindow, insert_mode: bool = ...) -> None: ... 9 | def edit(self, validate: Optional[Callable[[int], int]] = ...) -> str: ... 10 | def do_command(self, ch: Union[str, int]) -> None: ... 11 | def gather(self) -> str: ... 12 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/archive_util.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | def make_archive( 4 | base_name: str, 5 | format: str, 6 | root_dir: Optional[str] = ..., 7 | base_dir: Optional[str] = ..., 8 | verbose: int = ..., 9 | dry_run: int = ..., 10 | ) -> str: ... 11 | def make_tarball(base_name: str, base_dir: str, compress: Optional[str] = ..., verbose: int = ..., dry_run: int = ...) -> str: ... 12 | def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., dry_run: int = ...) -> str: ... 13 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/bcppcompiler.pyi: -------------------------------------------------------------------------------- 1 | from distutils.ccompiler import CCompiler 2 | 3 | class BCPPCompiler(CCompiler): ... 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/bdist.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/bdist.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/bdist_dumb.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/bdist_dumb.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/bdist_msi.pyi: -------------------------------------------------------------------------------- 1 | from distutils.cmd import Command 2 | 3 | class bdist_msi(Command): 4 | def initialize_options(self) -> None: ... 5 | def finalize_options(self) -> None: ... 6 | def run(self) -> None: ... 7 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/bdist_packager.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/bdist_packager.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/bdist_rpm.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/bdist_rpm.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/bdist_wininst.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/bdist_wininst.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/build.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/build.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/build_clib.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/build_clib.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/build_ext.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/build_ext.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/build_py.pyi: -------------------------------------------------------------------------------- 1 | from distutils.cmd import Command 2 | 3 | class build_py(Command): 4 | def initialize_options(self) -> None: ... 5 | def finalize_options(self) -> None: ... 6 | def run(self) -> None: ... 7 | 8 | class build_py_2to3(build_py): ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/build_scripts.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/build_scripts.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/check.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/check.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/clean.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/clean.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/install.pyi: -------------------------------------------------------------------------------- 1 | from distutils.cmd import Command 2 | from typing import Optional, Tuple 3 | 4 | SCHEME_KEYS: Tuple[str, ...] 5 | 6 | class install(Command): 7 | user: bool 8 | prefix: Optional[str] 9 | home: Optional[str] 10 | root: Optional[str] 11 | install_lib: Optional[str] 12 | def initialize_options(self) -> None: ... 13 | def finalize_options(self) -> None: ... 14 | def run(self) -> None: ... 15 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/install_data.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/install_data.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/install_egg_info.pyi: -------------------------------------------------------------------------------- 1 | from distutils.cmd import Command 2 | from typing import ClassVar, List, Optional, Tuple 3 | 4 | class install_egg_info(Command): 5 | description: ClassVar[str] 6 | user_options: ClassVar[List[Tuple[str, Optional[str], str]]] 7 | def initialize_options(self) -> None: ... 8 | def finalize_options(self) -> None: ... 9 | def run(self) -> None: ... 10 | def get_outputs(self) -> List[str]: ... 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/install_headers.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/install_headers.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/install_lib.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/install_lib.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/install_scripts.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/install_scripts.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/register.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/register.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/sdist.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/distutils/command/sdist.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/command/upload.pyi: -------------------------------------------------------------------------------- 1 | from distutils.config import PyPIRCCommand 2 | from typing import ClassVar, List 3 | 4 | class upload(PyPIRCCommand): 5 | description: ClassVar[str] 6 | boolean_options: ClassVar[List[str]] 7 | def run(self) -> None: ... 8 | def upload_file(self, command: str, pyversion: str, filename: str) -> None: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/config.pyi: -------------------------------------------------------------------------------- 1 | from abc import abstractmethod 2 | from distutils.cmd import Command 3 | from typing import ClassVar, List, Optional, Tuple 4 | 5 | DEFAULT_PYPIRC: str 6 | 7 | class PyPIRCCommand(Command): 8 | DEFAULT_REPOSITORY: ClassVar[str] 9 | DEFAULT_REALM: ClassVar[str] 10 | repository: None 11 | realm: None 12 | user_options: ClassVar[List[Tuple[str, Optional[str], str]]] 13 | boolean_options: ClassVar[List[str]] 14 | def initialize_options(self) -> None: ... 15 | def finalize_options(self) -> None: ... 16 | @abstractmethod 17 | def run(self) -> None: ... 18 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/cygwinccompiler.pyi: -------------------------------------------------------------------------------- 1 | from distutils.unixccompiler import UnixCCompiler 2 | 3 | class CygwinCCompiler(UnixCCompiler): ... 4 | class Mingw32CCompiler(CygwinCCompiler): ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/debug.pyi: -------------------------------------------------------------------------------- 1 | DEBUG: bool 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/dep_util.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, Tuple 2 | 3 | def newer(source: str, target: str) -> bool: ... 4 | def newer_pairwise(sources: List[str], targets: List[str]) -> List[Tuple[str, str]]: ... 5 | def newer_group(sources: List[str], target: str, missing: str = ...) -> bool: ... 6 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/dir_util.pyi: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | def mkpath(name: str, mode: int = ..., verbose: int = ..., dry_run: int = ...) -> List[str]: ... 4 | def create_tree(base_dir: str, files: List[str], mode: int = ..., verbose: int = ..., dry_run: int = ...) -> None: ... 5 | def copy_tree( 6 | src: str, 7 | dst: str, 8 | preserve_mode: int = ..., 9 | preserve_times: int = ..., 10 | preserve_symlinks: int = ..., 11 | update: int = ..., 12 | verbose: int = ..., 13 | dry_run: int = ..., 14 | ) -> List[str]: ... 15 | def remove_tree(directory: str, verbose: int = ..., dry_run: int = ...) -> None: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/file_util.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional, Sequence, Tuple 2 | 3 | def copy_file( 4 | src: str, 5 | dst: str, 6 | preserve_mode: bool = ..., 7 | preserve_times: bool = ..., 8 | update: bool = ..., 9 | link: Optional[str] = ..., 10 | verbose: bool = ..., 11 | dry_run: bool = ..., 12 | ) -> Tuple[str, str]: ... 13 | def move_file(src: str, dst: str, verbose: bool = ..., dry_run: bool = ...) -> str: ... 14 | def write_file(filename: str, contents: Sequence[str]) -> None: ... 15 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/filelist.pyi: -------------------------------------------------------------------------------- 1 | class FileList: ... 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/msvccompiler.pyi: -------------------------------------------------------------------------------- 1 | from distutils.ccompiler import CCompiler 2 | 3 | class MSVCCompiler(CCompiler): ... 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/spawn.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | def spawn(cmd: List[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ...) -> None: ... 4 | def find_executable(executable: str, path: Optional[str] = ...) -> Optional[str]: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/sysconfig.pyi: -------------------------------------------------------------------------------- 1 | from distutils.ccompiler import CCompiler 2 | from typing import Mapping, Optional, Union 3 | 4 | PREFIX: str 5 | EXEC_PREFIX: str 6 | 7 | def get_config_var(name: str) -> Union[int, str, None]: ... 8 | def get_config_vars(*args: str) -> Mapping[str, Union[int, str]]: ... 9 | def get_config_h_filename() -> str: ... 10 | def get_makefile_filename() -> str: ... 11 | def get_python_inc(plat_specific: bool = ..., prefix: Optional[str] = ...) -> str: ... 12 | def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., prefix: Optional[str] = ...) -> str: ... 13 | def customize_compiler(compiler: CCompiler) -> None: ... 14 | def set_python_build() -> None: ... 15 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/text_file.pyi: -------------------------------------------------------------------------------- 1 | from typing import IO, List, Optional, Tuple, Union 2 | 3 | class TextFile: 4 | def __init__( 5 | self, 6 | filename: Optional[str] = ..., 7 | file: Optional[IO[str]] = ..., 8 | *, 9 | strip_comments: bool = ..., 10 | lstrip_ws: bool = ..., 11 | rstrip_ws: bool = ..., 12 | skip_blanks: bool = ..., 13 | join_lines: bool = ..., 14 | collapse_join: bool = ..., 15 | ) -> None: ... 16 | def open(self, filename: str) -> None: ... 17 | def close(self) -> None: ... 18 | def warn(self, msg: str, line: Union[List[int], Tuple[int, int], int] = ...) -> None: ... 19 | def readline(self) -> Optional[str]: ... 20 | def readlines(self) -> List[str]: ... 21 | def unreadline(self, line: str) -> str: ... 22 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/distutils/unixccompiler.pyi: -------------------------------------------------------------------------------- 1 | from distutils.ccompiler import CCompiler 2 | 3 | class UnixCCompiler(CCompiler): ... 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/dummy_threading.pyi: -------------------------------------------------------------------------------- 1 | from _dummy_threading import * 2 | from _dummy_threading import __all__ as __all__ 3 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/email/contentmanager.pyi: -------------------------------------------------------------------------------- 1 | from email.message import Message 2 | from typing import Any, Callable 3 | 4 | class ContentManager: 5 | def __init__(self) -> None: ... 6 | def get_content(self, msg: Message, *args: Any, **kw: Any) -> Any: ... 7 | def set_content(self, msg: Message, obj: Any, *args: Any, **kw: Any) -> Any: ... 8 | def add_get_handler(self, key: str, handler: Callable[..., Any]) -> None: ... 9 | def add_set_handler(self, typekey: type, handler: Callable[..., Any]) -> None: ... 10 | 11 | raw_data_manager: ContentManager 12 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/email/encoders.pyi: -------------------------------------------------------------------------------- 1 | from email.message import Message 2 | 3 | def encode_base64(msg: Message) -> None: ... 4 | def encode_quopri(msg: Message) -> None: ... 5 | def encode_7or8bit(msg: Message) -> None: ... 6 | def encode_noop(msg: Message) -> None: ... 7 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/email/iterators.pyi: -------------------------------------------------------------------------------- 1 | from email.message import Message 2 | from typing import Iterator, Optional 3 | 4 | def body_line_iterator(msg: Message, decode: bool = ...) -> Iterator[str]: ... 5 | def typed_subpart_iterator(msg: Message, maintype: str = ..., subtype: Optional[str] = ...) -> Iterator[str]: ... 6 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/email/mime/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/email/mime/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/email/mime/application.pyi: -------------------------------------------------------------------------------- 1 | from email.mime.nonmultipart import MIMENonMultipart 2 | from email.policy import Policy 3 | from typing import Callable, Optional, Tuple, Union 4 | 5 | _ParamsType = Union[str, None, Tuple[str, Optional[str], str]] 6 | 7 | class MIMEApplication(MIMENonMultipart): 8 | def __init__( 9 | self, 10 | _data: Union[str, bytes], 11 | _subtype: str = ..., 12 | _encoder: Callable[[MIMEApplication], None] = ..., 13 | *, 14 | policy: Optional[Policy] = ..., 15 | **_params: _ParamsType, 16 | ) -> None: ... 17 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/email/mime/audio.pyi: -------------------------------------------------------------------------------- 1 | from email.mime.nonmultipart import MIMENonMultipart 2 | from email.policy import Policy 3 | from typing import Callable, Optional, Tuple, Union 4 | 5 | _ParamsType = Union[str, None, Tuple[str, Optional[str], str]] 6 | 7 | class MIMEAudio(MIMENonMultipart): 8 | def __init__( 9 | self, 10 | _audiodata: Union[str, bytes], 11 | _subtype: Optional[str] = ..., 12 | _encoder: Callable[[MIMEAudio], None] = ..., 13 | *, 14 | policy: Optional[Policy] = ..., 15 | **_params: _ParamsType, 16 | ) -> None: ... 17 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/email/mime/base.pyi: -------------------------------------------------------------------------------- 1 | import email.message 2 | from email.policy import Policy 3 | from typing import Optional, Tuple, Union 4 | 5 | _ParamsType = Union[str, None, Tuple[str, Optional[str], str]] 6 | 7 | class MIMEBase(email.message.Message): 8 | def __init__(self, _maintype: str, _subtype: str, *, policy: Optional[Policy] = ..., **_params: _ParamsType) -> None: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/email/mime/image.pyi: -------------------------------------------------------------------------------- 1 | from email.mime.nonmultipart import MIMENonMultipart 2 | from email.policy import Policy 3 | from typing import Callable, Optional, Tuple, Union 4 | 5 | _ParamsType = Union[str, None, Tuple[str, Optional[str], str]] 6 | 7 | class MIMEImage(MIMENonMultipart): 8 | def __init__( 9 | self, 10 | _imagedata: Union[str, bytes], 11 | _subtype: Optional[str] = ..., 12 | _encoder: Callable[[MIMEImage], None] = ..., 13 | *, 14 | policy: Optional[Policy] = ..., 15 | **_params: _ParamsType, 16 | ) -> None: ... 17 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/email/mime/message.pyi: -------------------------------------------------------------------------------- 1 | from email.message import Message 2 | from email.mime.nonmultipart import MIMENonMultipart 3 | from email.policy import Policy 4 | from typing import Optional 5 | 6 | class MIMEMessage(MIMENonMultipart): 7 | def __init__(self, _msg: Message, _subtype: str = ..., *, policy: Optional[Policy] = ...) -> None: ... 8 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/email/mime/multipart.pyi: -------------------------------------------------------------------------------- 1 | from email.message import Message 2 | from email.mime.base import MIMEBase 3 | from email.policy import Policy 4 | from typing import Optional, Sequence, Tuple, Union 5 | 6 | _ParamsType = Union[str, None, Tuple[str, Optional[str], str]] 7 | 8 | class MIMEMultipart(MIMEBase): 9 | def __init__( 10 | self, 11 | _subtype: str = ..., 12 | boundary: Optional[str] = ..., 13 | _subparts: Optional[Sequence[Message]] = ..., 14 | *, 15 | policy: Optional[Policy] = ..., 16 | **_params: _ParamsType, 17 | ) -> None: ... 18 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/email/mime/nonmultipart.pyi: -------------------------------------------------------------------------------- 1 | from email.mime.base import MIMEBase 2 | 3 | class MIMENonMultipart(MIMEBase): ... 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/email/mime/text.pyi: -------------------------------------------------------------------------------- 1 | from email.mime.nonmultipart import MIMENonMultipart 2 | from email.policy import Policy 3 | from typing import Optional 4 | 5 | class MIMEText(MIMENonMultipart): 6 | def __init__( 7 | self, _text: str, _subtype: str = ..., _charset: Optional[str] = ..., *, policy: Optional[Policy] = ... 8 | ) -> None: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/encodings/__init__.pyi: -------------------------------------------------------------------------------- 1 | import codecs 2 | from typing import Any 3 | 4 | def search_function(encoding: str) -> codecs.CodecInfo: ... 5 | 6 | # Explicitly mark this package as incomplete. 7 | def __getattr__(name: str) -> Any: ... 8 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/encodings/utf_8.pyi: -------------------------------------------------------------------------------- 1 | import codecs 2 | from typing import Tuple 3 | 4 | class IncrementalEncoder(codecs.IncrementalEncoder): 5 | def encode(self, input: str, final: bool = ...) -> bytes: ... 6 | 7 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 8 | def _buffer_decode(self, input: bytes, errors: str, final: bool) -> Tuple[str, int]: ... 9 | 10 | class StreamWriter(codecs.StreamWriter): ... 11 | class StreamReader(codecs.StreamReader): ... 12 | 13 | def getregentry() -> codecs.CodecInfo: ... 14 | def encode(input: str, errors: str = ...) -> bytes: ... 15 | def decode(input: bytes, errors: str = ...) -> str: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/ensurepip/__init__.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Optional 3 | 4 | def version() -> str: ... 5 | 6 | if sys.version_info >= (3, 0): 7 | def bootstrap( 8 | *, 9 | root: Optional[str] = ..., 10 | upgrade: bool = ..., 11 | user: bool = ..., 12 | altinstall: bool = ..., 13 | default_pip: bool = ..., 14 | verbosity: int = ..., 15 | ) -> None: ... 16 | 17 | else: 18 | def bootstrap( 19 | root: Optional[str] = ..., 20 | upgrade: bool = ..., 21 | user: bool = ..., 22 | altinstall: bool = ..., 23 | default_pip: bool = ..., 24 | verbosity: int = ..., 25 | ) -> None: ... 26 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/faulthandler.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from _typeshed import FileDescriptorLike 3 | 4 | def cancel_dump_traceback_later() -> None: ... 5 | def disable() -> None: ... 6 | def dump_traceback(file: FileDescriptorLike = ..., all_threads: bool = ...) -> None: ... 7 | def dump_traceback_later(timeout: float, repeat: bool = ..., file: FileDescriptorLike = ..., exit: bool = ...) -> None: ... 8 | def enable(file: FileDescriptorLike = ..., all_threads: bool = ...) -> None: ... 9 | def is_enabled() -> bool: ... 10 | 11 | if sys.platform != "win32": 12 | def register(signum: int, file: FileDescriptorLike = ..., all_threads: bool = ..., chain: bool = ...) -> None: ... 13 | def unregister(signum: int) -> None: ... 14 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/fnmatch.pyi: -------------------------------------------------------------------------------- 1 | from typing import AnyStr, Iterable, List 2 | 3 | def fnmatch(name: AnyStr, pat: AnyStr) -> bool: ... 4 | def fnmatchcase(name: AnyStr, pat: AnyStr) -> bool: ... 5 | def filter(names: Iterable[AnyStr], pat: AnyStr) -> List[AnyStr]: ... 6 | def translate(pat: str) -> str: ... 7 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/getopt.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, Tuple 2 | 3 | def getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... 4 | def gnu_getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... 5 | 6 | class GetoptError(Exception): 7 | msg: str 8 | opt: str 9 | 10 | error = GetoptError 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/getpass.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional, TextIO 2 | 3 | def getpass(prompt: str = ..., stream: Optional[TextIO] = ...) -> str: ... 4 | def getuser() -> str: ... 5 | 6 | class GetPassWarning(UserWarning): ... 7 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/glob.pyi: -------------------------------------------------------------------------------- 1 | from typing import AnyStr, Iterator, List, Union 2 | 3 | def glob0(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ... 4 | def glob1(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ... 5 | def glob(pathname: AnyStr, *, recursive: bool = ...) -> List[AnyStr]: ... 6 | def iglob(pathname: AnyStr, *, recursive: bool = ...) -> Iterator[AnyStr]: ... 7 | def escape(pathname: AnyStr) -> AnyStr: ... 8 | def has_magic(s: Union[str, bytes]) -> bool: ... # undocumented 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/graphlib.pyi: -------------------------------------------------------------------------------- 1 | from _typeshed import SupportsItems 2 | from typing import Generic, Iterable, Optional, Tuple, TypeVar 3 | 4 | _T = TypeVar("_T") 5 | 6 | class TopologicalSorter(Generic[_T]): 7 | def __init__(self, graph: Optional[SupportsItems[_T, Iterable[_T]]] = ...) -> None: ... 8 | def add(self, node: _T, *predecessors: _T) -> None: ... 9 | def prepare(self) -> None: ... 10 | def is_active(self) -> bool: ... 11 | def __bool__(self) -> bool: ... 12 | def done(self, *nodes: _T) -> None: ... 13 | def get_ready(self) -> Tuple[_T, ...]: ... 14 | def static_order(self) -> Iterable[_T]: ... 15 | 16 | class CycleError(ValueError): ... 17 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/grp.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, NamedTuple, Optional 2 | 3 | class struct_group(NamedTuple): 4 | gr_name: str 5 | gr_passwd: Optional[str] 6 | gr_gid: int 7 | gr_mem: List[str] 8 | 9 | def getgrall() -> List[struct_group]: ... 10 | def getgrgid(gid: int) -> struct_group: ... 11 | def getgrnam(name: str) -> struct_group: ... 12 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/html/__init__.pyi: -------------------------------------------------------------------------------- 1 | from typing import AnyStr 2 | 3 | def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ... 4 | def unescape(s: AnyStr) -> AnyStr: ... 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/html/entities.pyi: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | name2codepoint: Dict[str, int] 4 | html5: Dict[str, str] 5 | codepoint2name: Dict[int, str] 6 | entitydefs: Dict[str, str] 7 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/imghdr.pyi: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | from typing import Any, BinaryIO, Callable, List, Optional, Protocol, Text, Union, overload 4 | 5 | class _ReadableBinary(Protocol): 6 | def tell(self) -> int: ... 7 | def read(self, size: int) -> bytes: ... 8 | def seek(self, offset: int) -> Any: ... 9 | 10 | if sys.version_info >= (3, 6): 11 | _File = Union[Text, os.PathLike[Text], _ReadableBinary] 12 | else: 13 | _File = Union[Text, _ReadableBinary] 14 | 15 | @overload 16 | def what(file: _File, h: None = ...) -> Optional[str]: ... 17 | @overload 18 | def what(file: Any, h: bytes) -> Optional[str]: ... 19 | 20 | tests: List[Callable[[bytes, Optional[BinaryIO]], Optional[str]]] 21 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/importlib/__init__.pyi: -------------------------------------------------------------------------------- 1 | import types 2 | from importlib.abc import Loader 3 | from typing import Any, Mapping, Optional, Sequence 4 | 5 | def __import__( 6 | name: str, 7 | globals: Optional[Mapping[str, Any]] = ..., 8 | locals: Optional[Mapping[str, Any]] = ..., 9 | fromlist: Sequence[str] = ..., 10 | level: int = ..., 11 | ) -> types.ModuleType: ... 12 | def import_module(name: str, package: Optional[str] = ...) -> types.ModuleType: ... 13 | def find_loader(name: str, path: Optional[str] = ...) -> Optional[Loader]: ... 14 | def invalidate_caches() -> None: ... 15 | def reload(module: types.ModuleType) -> types.ModuleType: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/json/tool.pyi: -------------------------------------------------------------------------------- 1 | def main() -> None: ... 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/keyword.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Sequence, Text 3 | 4 | def iskeyword(s: Text) -> bool: ... 5 | 6 | kwlist: Sequence[str] 7 | 8 | if sys.version_info >= (3, 9): 9 | def issoftkeyword(s: str) -> bool: ... 10 | softkwlist: Sequence[str] 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/lib2to3/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/lib2to3/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/lib2to3/pgen2/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/lib2to3/pgen2/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/lib2to3/pgen2/literals.pyi: -------------------------------------------------------------------------------- 1 | from typing import Dict, Match, Text 2 | 3 | simple_escapes: Dict[Text, Text] 4 | 5 | def escape(m: Match[str]) -> Text: ... 6 | def evalString(s: Text) -> Text: ... 7 | def test() -> None: ... 8 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/linecache.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Any, Dict, List, Optional, Text 3 | 4 | _ModuleGlobals = Dict[str, Any] 5 | 6 | def getline(filename: Text, lineno: int, module_globals: Optional[_ModuleGlobals] = ...) -> str: ... 7 | def clearcache() -> None: ... 8 | def getlines(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ... 9 | def checkcache(filename: Optional[Text] = ...) -> None: ... 10 | def updatecache(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ... 11 | 12 | if sys.version_info >= (3, 5): 13 | def lazycache(filename: Text, module_globals: _ModuleGlobals) -> bool: ... 14 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/macurl2path.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Union 3 | 4 | if sys.version_info < (3, 7): 5 | def url2pathname(pathname: str) -> str: ... 6 | def pathname2url(pathname: str) -> str: ... 7 | def _pncomp2url(component: Union[str, bytes]) -> str: ... 8 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/mailcap.pyi: -------------------------------------------------------------------------------- 1 | from typing import Dict, List, Mapping, Optional, Sequence, Tuple, Union 2 | 3 | _Cap = Dict[str, Union[str, int]] 4 | 5 | def findmatch( 6 | caps: Mapping[str, List[_Cap]], MIMEtype: str, key: str = ..., filename: str = ..., plist: Sequence[str] = ... 7 | ) -> Tuple[Optional[str], Optional[_Cap]]: ... 8 | def getcaps() -> Dict[str, List[_Cap]]: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/marshal.pyi: -------------------------------------------------------------------------------- 1 | from typing import IO, Any 2 | 3 | version: int 4 | 5 | def dump(__value: Any, __file: IO[Any], __version: int = ...) -> None: ... 6 | def load(__file: IO[Any]) -> Any: ... 7 | def dumps(__value: Any, __version: int = ...) -> bytes: ... 8 | def loads(__bytes: bytes) -> Any: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/msilib/sequence.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import List, Optional, Tuple 3 | 4 | if sys.platform == "win32": 5 | 6 | _SequenceType = List[Tuple[str, Optional[str], int]] 7 | 8 | AdminExecuteSequence: _SequenceType 9 | AdminUISequence: _SequenceType 10 | AdvtExecuteSequence: _SequenceType 11 | InstallExecuteSequence: _SequenceType 12 | InstallUISequence: _SequenceType 13 | 14 | tables: List[str] 15 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/msilib/text.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import List, Optional, Tuple 3 | 4 | if sys.platform == "win32": 5 | 6 | ActionText: List[Tuple[str, str, Optional[str]]] 7 | UIText: List[Tuple[str, Optional[str]]] 8 | 9 | tables: List[str] 10 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/multiprocessing/spawn.pyi: -------------------------------------------------------------------------------- 1 | from types import ModuleType 2 | from typing import Any, Dict, List, Mapping, Optional, Sequence 3 | 4 | WINEXE: bool 5 | WINSERVICE: bool 6 | 7 | def set_executable(exe: str) -> None: ... 8 | def get_executable() -> str: ... 9 | def is_forking(argv: Sequence[str]) -> bool: ... 10 | def freeze_support() -> None: ... 11 | def get_command_line(**kwds: Any) -> List[str]: ... 12 | def spawn_main(pipe_handle: int, parent_pid: Optional[int] = ..., tracker_fd: Optional[int] = ...) -> None: ... 13 | 14 | # undocumented 15 | def _main(fd: int) -> Any: ... 16 | def get_preparation_data(name: str) -> Dict[str, Any]: ... 17 | 18 | old_main_modules: List[ModuleType] 19 | 20 | def prepare(data: Mapping[str, Any]) -> None: ... 21 | def import_main_path(main_path: str) -> None: ... 22 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/netrc.pyi: -------------------------------------------------------------------------------- 1 | from typing import Dict, List, Optional, Tuple 2 | 3 | class NetrcParseError(Exception): 4 | filename: Optional[str] 5 | lineno: Optional[int] 6 | msg: str 7 | 8 | # (login, account, password) tuple 9 | _NetrcTuple = Tuple[str, Optional[str], Optional[str]] 10 | 11 | class netrc: 12 | hosts: Dict[str, _NetrcTuple] 13 | macros: Dict[str, List[str]] 14 | def __init__(self, file: str = ...) -> None: ... 15 | def authenticators(self, host: str) -> Optional[_NetrcTuple]: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/nis.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Dict, List 3 | 4 | if sys.platform != "win32": 5 | def cat(map: str, domain: str = ...) -> Dict[str, str]: ... 6 | def get_default_domain() -> str: ... 7 | def maps(domain: str = ...) -> List[str]: ... 8 | def match(key: str, map: str, domain: str = ...) -> str: ... 9 | class error(Exception): ... 10 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/nturl2path.pyi: -------------------------------------------------------------------------------- 1 | def url2pathname(url: str) -> str: ... 2 | def pathname2url(p: str) -> str: ... 3 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/opcode.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Dict, List, Optional, Sequence 3 | 4 | cmp_op: Sequence[str] 5 | hasconst: List[int] 6 | hasname: List[int] 7 | hasjrel: List[int] 8 | hasjabs: List[int] 9 | haslocal: List[int] 10 | hascompare: List[int] 11 | hasfree: List[int] 12 | opname: List[str] 13 | 14 | opmap: Dict[str, int] 15 | HAVE_ARGUMENT: int 16 | EXTENDED_ARG: int 17 | 18 | if sys.version_info >= (3, 8): 19 | def stack_effect(__opcode: int, __oparg: Optional[int] = ..., *, jump: Optional[bool] = ...) -> int: ... 20 | 21 | elif sys.version_info >= (3, 4): 22 | def stack_effect(__opcode: int, __oparg: Optional[int] = ...) -> int: ... 23 | 24 | if sys.version_info >= (3, 6): 25 | hasnargs: List[int] 26 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/pipes.pyi: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | class Template: 4 | def __init__(self) -> None: ... 5 | def reset(self) -> None: ... 6 | def clone(self) -> Template: ... 7 | def debug(self, flag: bool) -> None: ... 8 | def append(self, cmd: str, kind: str) -> None: ... 9 | def prepend(self, cmd: str, kind: str) -> None: ... 10 | def open(self, file: str, rw: str) -> os._wrap_close: ... 11 | def copy(self, file: str, rw: str) -> os._wrap_close: ... 12 | 13 | # Not documented, but widely used. 14 | # Documented as shlex.quote since 3.3. 15 | def quote(s: str) -> str: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/pty.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Callable, Iterable, Tuple, Union 3 | 4 | _Reader = Callable[[int], bytes] 5 | 6 | STDIN_FILENO: int 7 | STDOUT_FILENO: int 8 | STDERR_FILENO: int 9 | 10 | CHILD: int 11 | 12 | def openpty() -> Tuple[int, int]: ... 13 | def master_open() -> Tuple[int, str]: ... 14 | def slave_open(tty_name: str) -> int: ... 15 | def fork() -> Tuple[int, int]: ... 16 | 17 | if sys.version_info >= (3, 4): 18 | def spawn(argv: Union[str, Iterable[str]], master_read: _Reader = ..., stdin_read: _Reader = ...) -> int: ... 19 | 20 | else: 21 | def spawn(argv: Union[str, Iterable[str]], master_read: _Reader = ..., stdin_read: _Reader = ...) -> None: ... 22 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/pwd.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, Tuple 2 | 3 | class struct_passwd(Tuple[str, str, int, int, str, str, str]): 4 | pw_name: str 5 | pw_passwd: str 6 | pw_uid: int 7 | pw_gid: int 8 | pw_gecos: str 9 | pw_dir: str 10 | pw_shell: str 11 | 12 | def getpwall() -> List[struct_passwd]: ... 13 | def getpwuid(uid: int) -> struct_passwd: ... 14 | def getpwnam(name: str) -> struct_passwd: ... 15 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/pydoc_data/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/pydoc_data/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/pydoc_data/topics.pyi: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | topics: Dict[str, str] 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/pyexpat/model.pyi: -------------------------------------------------------------------------------- 1 | XML_CTYPE_ANY: int 2 | XML_CTYPE_CHOICE: int 3 | XML_CTYPE_EMPTY: int 4 | XML_CTYPE_MIXED: int 5 | XML_CTYPE_NAME: int 6 | XML_CTYPE_SEQ: int 7 | 8 | XML_CQUANT_NONE: int 9 | XML_CQUANT_OPT: int 10 | XML_CQUANT_PLUS: int 11 | XML_CQUANT_REP: int 12 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/quopri.pyi: -------------------------------------------------------------------------------- 1 | from typing import BinaryIO 2 | 3 | def encode(input: BinaryIO, output: BinaryIO, quotetabs: int, header: int = ...) -> None: ... 4 | def encodestring(s: bytes, quotetabs: int = ..., header: int = ...) -> bytes: ... 5 | def decode(input: BinaryIO, output: BinaryIO, header: int = ...) -> None: ... 6 | def decodestring(s: bytes, header: int = ...) -> bytes: ... 7 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/rlcompleter.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Any, Dict, Optional, Union 3 | 4 | if sys.version_info >= (3,): 5 | _Text = str 6 | else: 7 | _Text = Union[str, unicode] 8 | 9 | class Completer: 10 | def __init__(self, namespace: Optional[Dict[str, Any]] = ...) -> None: ... 11 | def complete(self, text: _Text, state: int) -> Optional[str]: ... 12 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/secrets.pyi: -------------------------------------------------------------------------------- 1 | from hmac import compare_digest as compare_digest 2 | from random import SystemRandom as SystemRandom 3 | from typing import Optional, Sequence, TypeVar 4 | 5 | _T = TypeVar("_T") 6 | 7 | def randbelow(exclusive_upper_bound: int) -> int: ... 8 | def randbits(k: int) -> int: ... 9 | def choice(seq: Sequence[_T]) -> _T: ... 10 | def token_bytes(nbytes: Optional[int] = ...) -> bytes: ... 11 | def token_hex(nbytes: Optional[int] = ...) -> str: ... 12 | def token_urlsafe(nbytes: Optional[int] = ...) -> str: ... 13 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/site.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Iterable, List, Optional 3 | 4 | PREFIXES: List[str] 5 | ENABLE_USER_SITE: Optional[bool] 6 | USER_SITE: Optional[str] 7 | USER_BASE: Optional[str] 8 | 9 | if sys.version_info < (3,): 10 | def main() -> None: ... 11 | 12 | def addsitedir(sitedir: str, known_paths: Optional[Iterable[str]] = ...) -> None: ... 13 | def getsitepackages(prefixes: Optional[Iterable[str]] = ...) -> List[str]: ... 14 | def getuserbase() -> str: ... 15 | def getusersitepackages() -> str: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/sndhdr.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from _typeshed import AnyPath 3 | from typing import NamedTuple, Optional, Tuple, Union 4 | 5 | if sys.version_info >= (3, 5): 6 | class SndHeaders(NamedTuple): 7 | filetype: str 8 | framerate: int 9 | nchannels: int 10 | nframes: int 11 | sampwidth: Union[int, str] 12 | _SndHeaders = SndHeaders 13 | else: 14 | _SndHeaders = Tuple[str, int, int, int, Union[int, str]] 15 | 16 | def what(filename: AnyPath) -> Optional[_SndHeaders]: ... 17 | def whathdr(filename: AnyPath) -> Optional[_SndHeaders]: ... 18 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/spwd.pyi: -------------------------------------------------------------------------------- 1 | from typing import List, NamedTuple 2 | 3 | class struct_spwd(NamedTuple): 4 | sp_namp: str 5 | sp_pwdp: str 6 | sp_lstchg: int 7 | sp_min: int 8 | sp_max: int 9 | sp_warn: int 10 | sp_inact: int 11 | sp_expire: int 12 | sp_flag: int 13 | 14 | def getspall() -> List[struct_spwd]: ... 15 | def getspnam(name: str) -> struct_spwd: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/sqlite3/__init__.pyi: -------------------------------------------------------------------------------- 1 | from sqlite3.dbapi2 import * # noqa: F403 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/tabnanny.pyi: -------------------------------------------------------------------------------- 1 | from _typeshed import AnyPath 2 | from typing import Iterable, Tuple 3 | 4 | verbose: int 5 | filename_only: int 6 | 7 | class NannyNag(Exception): 8 | def __init__(self, lineno: int, msg: str, line: str) -> None: ... 9 | def get_lineno(self) -> int: ... 10 | def get_msg(self) -> str: ... 11 | def get_line(self) -> str: ... 12 | 13 | def check(file: AnyPath) -> None: ... 14 | def process_tokens(tokens: Iterable[Tuple[int, str, Tuple[int, int], Tuple[int, int], str]]) -> None: ... 15 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/this.pyi: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | s: str 4 | d: Dict[str, str] 5 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/tkinter/commondialog.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Mapping, Optional 2 | 3 | class Dialog: 4 | command: Optional[Any] = ... 5 | master: Optional[Any] = ... 6 | options: Mapping[str, Any] = ... 7 | def __init__(self, master: Optional[Any] = ..., **options) -> None: ... 8 | def show(self, **options) -> Any: ... 9 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/tkinter/dialog.pyi: -------------------------------------------------------------------------------- 1 | from tkinter import Widget 2 | from typing import Any, Mapping, Optional 3 | 4 | DIALOG_ICON: str 5 | 6 | class Dialog(Widget): 7 | widgetName: str = ... 8 | num: int = ... 9 | def __init__(self, master: Optional[Any] = ..., cnf: Mapping[str, Any] = ..., **kw) -> None: ... 10 | def destroy(self) -> None: ... 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/tty.pyi: -------------------------------------------------------------------------------- 1 | from typing import IO, Union 2 | 3 | _FD = Union[int, IO[str]] 4 | 5 | # XXX: Undocumented integer constants 6 | IFLAG: int 7 | OFLAG: int 8 | CFLAG: int 9 | LFLAG: int 10 | ISPEED: int 11 | OSPEED: int 12 | CC: int 13 | 14 | def setraw(fd: _FD, when: int = ...) -> None: ... 15 | def setcbreak(fd: _FD, when: int = ...) -> None: ... 16 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/unittest/__init__.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | from unittest.async_case import * 3 | from unittest.case import * 4 | from unittest.loader import * 5 | from unittest.main import * 6 | from unittest.result import TestResult as TestResult 7 | from unittest.runner import * 8 | from unittest.signals import * 9 | from unittest.suite import * 10 | 11 | def load_tests(loader: TestLoader, tests: TestSuite, pattern: Optional[str]) -> TestSuite: ... 12 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/unittest/async_case.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Any, Awaitable, Callable 3 | 4 | from .case import TestCase 5 | 6 | if sys.version_info >= (3, 8): 7 | class IsolatedAsyncioTestCase(TestCase): 8 | async def asyncSetUp(self) -> None: ... 9 | async def asyncTearDown(self) -> None: ... 10 | def addAsyncCleanup(self, __func: Callable[..., Awaitable[Any]], *args: Any, **kwargs: Any) -> None: ... 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/unittest/signals.pyi: -------------------------------------------------------------------------------- 1 | import unittest.result 2 | from typing import Any, Callable, TypeVar, overload 3 | 4 | _F = TypeVar("_F", bound=Callable[..., Any]) 5 | 6 | def installHandler() -> None: ... 7 | def registerResult(result: unittest.result.TestResult) -> None: ... 8 | def removeResult(result: unittest.result.TestResult) -> bool: ... 9 | @overload 10 | def removeHandler(method: None = ...) -> None: ... 11 | @overload 12 | def removeHandler(method: _F) -> _F: ... 13 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/urllib/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/urllib/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/urllib/error.pyi: -------------------------------------------------------------------------------- 1 | from typing import IO, Mapping, Optional, Union 2 | from urllib.response import addinfourl 3 | 4 | # Stubs for urllib.error 5 | 6 | class URLError(IOError): 7 | reason: Union[str, BaseException] 8 | 9 | class HTTPError(URLError, addinfourl): 10 | code: int 11 | def __init__(self, url: str, code: int, msg: str, hdrs: Mapping[str, str], fp: Optional[IO[bytes]]) -> None: ... 12 | 13 | class ContentTooShortError(URLError): ... 14 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/urllib/robotparser.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Iterable, List, NamedTuple, Optional 3 | 4 | class _RequestRate(NamedTuple): 5 | requests: int 6 | seconds: int 7 | 8 | class RobotFileParser: 9 | def __init__(self, url: str = ...) -> None: ... 10 | def set_url(self, url: str) -> None: ... 11 | def read(self) -> None: ... 12 | def parse(self, lines: Iterable[str]) -> None: ... 13 | def can_fetch(self, user_agent: str, url: str) -> bool: ... 14 | def mtime(self) -> int: ... 15 | def modified(self) -> None: ... 16 | def crawl_delay(self, useragent: str) -> Optional[str]: ... 17 | def request_rate(self, useragent: str) -> Optional[_RequestRate]: ... 18 | if sys.version_info >= (3, 8): 19 | def site_maps(self) -> Optional[List[str]]: ... 20 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/uu.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import BinaryIO, Optional, Text, Union 3 | 4 | _File = Union[Text, BinaryIO] 5 | 6 | class Error(Exception): ... 7 | 8 | if sys.version_info >= (3, 7): 9 | def encode( 10 | in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ..., *, backtick: bool = ... 11 | ) -> None: ... 12 | 13 | else: 14 | def encode(in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ...) -> None: ... 15 | 16 | def decode(in_file: _File, out_file: Optional[_File] = ..., mode: Optional[int] = ..., quiet: int = ...) -> None: ... 17 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/wsgiref/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/wsgiref/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/wsgiref/types.pyi: -------------------------------------------------------------------------------- 1 | # Obsolete, use _typeshed.wsgi directly. 2 | 3 | from _typeshed.wsgi import * 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/__init__.pyi: -------------------------------------------------------------------------------- 1 | import xml.parsers as parsers 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/dom/NodeFilter.pyi: -------------------------------------------------------------------------------- 1 | class NodeFilter: 2 | FILTER_ACCEPT: int 3 | FILTER_REJECT: int 4 | FILTER_SKIP: int 5 | 6 | SHOW_ALL: int 7 | SHOW_ELEMENT: int 8 | SHOW_ATTRIBUTE: int 9 | SHOW_TEXT: int 10 | SHOW_CDATA_SECTION: int 11 | SHOW_ENTITY_REFERENCE: int 12 | SHOW_ENTITY: int 13 | SHOW_PROCESSING_INSTRUCTION: int 14 | SHOW_COMMENT: int 15 | SHOW_DOCUMENT: int 16 | SHOW_DOCUMENT_TYPE: int 17 | SHOW_DOCUMENT_FRAGMENT: int 18 | SHOW_NOTATION: int 19 | def acceptNode(self, node) -> int: ... 20 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/dom/domreg.pyi: -------------------------------------------------------------------------------- 1 | from _typeshed.xml import DOMImplementation 2 | from typing import Any, Callable, Dict, Iterable, Optional, Tuple, Union 3 | 4 | well_known_implementations: Dict[str, str] 5 | registered: Dict[str, Callable[[], DOMImplementation]] 6 | 7 | def registerDOMImplementation(name: str, factory: Callable[[], DOMImplementation]) -> None: ... 8 | def getDOMImplementation( 9 | name: Optional[str] = ..., features: Union[str, Iterable[Tuple[str, Optional[str]]]] = ... 10 | ) -> DOMImplementation: ... 11 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/dom/expatbuilder.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | def __getattr__(name: str) -> Any: ... # incomplete 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/dom/minicompat.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | def __getattr__(name: str) -> Any: ... # incomplete 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/dom/minidom.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Optional, Text, Union 2 | from xml.sax.xmlreader import XMLReader 3 | 4 | def parse(file: str, parser: Optional[XMLReader] = ..., bufsize: Optional[int] = ...): ... 5 | def parseString(string: Union[bytes, Text], parser: Optional[XMLReader] = ...): ... 6 | def __getattr__(name: str) -> Any: ... # incomplete 7 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/dom/pulldom.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | def __getattr__(name: str) -> Any: ... # incomplete 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/dom/xmlbuilder.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | def __getattr__(name: str) -> Any: ... # incomplete 4 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/etree/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/xml/etree/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/etree/cElementTree.pyi: -------------------------------------------------------------------------------- 1 | from xml.etree.ElementTree import * # noqa: F403 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/parsers/__init__.pyi: -------------------------------------------------------------------------------- 1 | import xml.parsers.expat as expat 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/parsers/expat/__init__.pyi: -------------------------------------------------------------------------------- 1 | from pyexpat import * 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/parsers/expat/errors.pyi: -------------------------------------------------------------------------------- 1 | from pyexpat.errors import * 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xml/parsers/expat/model.pyi: -------------------------------------------------------------------------------- 1 | from pyexpat.model import * 2 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xmlrpc/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypy/typeshed/stdlib/xmlrpc/__init__.pyi -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/xxlimited.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | class Null: ... 4 | class Str: ... 5 | 6 | class Xxo: 7 | def demo(self) -> None: ... 8 | 9 | class error: ... 10 | 11 | def foo(__i: int, __j: int) -> Any: ... 12 | def new() -> Xxo: ... 13 | def roj(__b: Any) -> None: ... 14 | -------------------------------------------------------------------------------- /mypy/typeshed/stdlib/zipapp.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from pathlib import Path 3 | from typing import BinaryIO, Callable, Optional, Union 4 | 5 | _Path = Union[str, Path, BinaryIO] 6 | 7 | class ZipAppError(ValueError): ... 8 | 9 | if sys.version_info >= (3, 7): 10 | def create_archive( 11 | source: _Path, 12 | target: Optional[_Path] = ..., 13 | interpreter: Optional[str] = ..., 14 | main: Optional[str] = ..., 15 | filter: Optional[Callable[[Path], bool]] = ..., 16 | compressed: bool = ..., 17 | ) -> None: ... 18 | 19 | else: 20 | def create_archive( 21 | source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ... 22 | ) -> None: ... 23 | 24 | def get_interpreter(archive: _Path) -> str: ... 25 | -------------------------------------------------------------------------------- /mypy/version.py: -------------------------------------------------------------------------------- 1 | import os 2 | from mypy import git 3 | 4 | # Base version. 5 | # - Release versions have the form "0.NNN". 6 | # - Dev versions have the form "0.NNN+dev" (PLUS sign to conform to PEP 440). 7 | # - For 1.0 we'll switch back to 1.2.3 form. 8 | __version__ = '0.820+dev' 9 | base_version = __version__ 10 | 11 | mypy_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) 12 | if __version__.endswith('+dev') and git.is_git_repo(mypy_dir) and git.have_git(): 13 | __version__ += '.' + git.git_revision(mypy_dir).decode('utf-8') 14 | if git.is_dirty(mypy_dir): 15 | __version__ += '.dirty' 16 | del mypy_dir 17 | -------------------------------------------------------------------------------- /mypy_bootstrap.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | disallow_untyped_calls = True 3 | disallow_untyped_defs = True 4 | disallow_incomplete_defs = True 5 | check_untyped_defs = True 6 | disallow_subclassing_any = True 7 | warn_no_return = True 8 | strict_optional = True 9 | no_implicit_optional = True 10 | disallow_any_generics = True 11 | disallow_any_unimported = True 12 | warn_redundant_casts = True 13 | warn_unused_configs = True 14 | show_traceback = True 15 | always_true = MYPYC 16 | -------------------------------------------------------------------------------- /mypy_self_check.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | disallow_untyped_calls = True 3 | disallow_untyped_defs = True 4 | disallow_incomplete_defs = True 5 | check_untyped_defs = True 6 | disallow_subclassing_any = True 7 | warn_no_return = True 8 | strict_optional = True 9 | strict_equality = True 10 | no_implicit_optional = True 11 | disallow_any_generics = True 12 | disallow_any_unimported = True 13 | warn_redundant_casts = True 14 | warn_unused_ignores = True 15 | warn_unused_configs = True 16 | show_traceback = True 17 | show_error_codes = True 18 | pretty = True 19 | always_false = MYPYC 20 | plugins = misc/proper_plugin.py 21 | python_version = 3.5 22 | exclude = /mypy/typeshed/ 23 | -------------------------------------------------------------------------------- /mypyc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypyc/__init__.py -------------------------------------------------------------------------------- /mypyc/analysis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypyc/analysis/__init__.py -------------------------------------------------------------------------------- /mypyc/codegen/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypyc/codegen/__init__.py -------------------------------------------------------------------------------- /mypyc/doc/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /mypyc/doc/bool_operations.rst: -------------------------------------------------------------------------------- 1 | .. _bool-ops: 2 | 3 | Native boolean operations 4 | ========================= 5 | 6 | Operations on ``bool`` values that are listed here have fast, 7 | optimized implementations. 8 | 9 | Construction 10 | ------------ 11 | 12 | * ``True`` 13 | * ``False`` 14 | * ``bool(obj)`` 15 | 16 | Operators 17 | --------- 18 | 19 | * ``b1 and b2`` 20 | * ``b1 or b2`` 21 | * ``not b`` 22 | 23 | Functions 24 | --------- 25 | 26 | * ``any(expr for ... in ...)`` 27 | * ``all(expr for ... in ...)`` 28 | -------------------------------------------------------------------------------- /mypyc/doc/float_operations.rst: -------------------------------------------------------------------------------- 1 | .. _float-ops: 2 | 3 | Native float operations 4 | ======================== 5 | 6 | These ``float`` operations have fast, optimized implementations. Other 7 | floating point operations use generic implementations that are often 8 | slower. 9 | 10 | .. note:: 11 | 12 | At the moment, only a few float operations are optimized. This will 13 | improve in future mypyc releases. 14 | 15 | Construction 16 | ------------ 17 | 18 | * Float literal 19 | * ``float(string)`` 20 | 21 | Functions 22 | --------- 23 | 24 | * ``abs(f)`` 25 | -------------------------------------------------------------------------------- /mypyc/errors.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | import mypy.errors 4 | 5 | 6 | class Errors: 7 | def __init__(self) -> None: 8 | self.num_errors = 0 9 | self.num_warnings = 0 10 | self._errors = mypy.errors.Errors() 11 | 12 | def error(self, msg: str, path: str, line: int) -> None: 13 | self._errors.report(line, None, msg, severity='error', file=path) 14 | self.num_errors += 1 15 | 16 | def warning(self, msg: str, path: str, line: int) -> None: 17 | self._errors.report(line, None, msg, severity='warning', file=path) 18 | self.num_warnings += 1 19 | 20 | def new_messages(self) -> List[str]: 21 | return self._errors.new_messages() 22 | 23 | def flush_errors(self) -> None: 24 | for error in self.new_messages(): 25 | print(error) 26 | -------------------------------------------------------------------------------- /mypyc/ir/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypyc/ir/__init__.py -------------------------------------------------------------------------------- /mypyc/irbuild/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypyc/irbuild/__init__.py -------------------------------------------------------------------------------- /mypyc/lib-rt/init.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "CPy.h" 3 | 4 | struct ExcDummyStruct _CPy_ExcDummyStruct = { PyObject_HEAD_INIT(NULL) }; 5 | PyObject *_CPy_ExcDummy = (PyObject *)&_CPy_ExcDummyStruct; 6 | 7 | // Because its dynamic linker is more restricted than linux/OS X, 8 | // Windows doesn't allow initializing globals with values from 9 | // other dynamic libraries. This means we need to initialize 10 | // things at load time. 11 | void CPy_Init(void) { 12 | _CPy_ExcDummyStruct.ob_base.ob_type = &PyBaseObject_Type; 13 | } 14 | -------------------------------------------------------------------------------- /mypyc/lib-rt/module_shim.tmpl: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | PyMODINIT_FUNC 4 | PyInit_{modname}(void) 5 | {{ 6 | PyObject *tmp; 7 | if (!(tmp = PyImport_ImportModule("{libname}"))) return NULL; 8 | Py_DECREF(tmp); 9 | void *init_func = PyCapsule_Import("{libname}.init_{full_modname}", 0); 10 | if (!init_func) {{ 11 | return NULL; 12 | }} 13 | return ((PyObject *(*)(void))init_func)(); 14 | }} 15 | 16 | // distutils sometimes spuriously tells cl to export CPyInit___init__, 17 | // so provide that so it chills out 18 | PyMODINIT_FUNC PyInit___init__(void) {{ return PyInit_{modname}(); }} 19 | -------------------------------------------------------------------------------- /mypyc/lib-rt/set_ops.c: -------------------------------------------------------------------------------- 1 | // Set primitive operations 2 | // 3 | // These are registered in mypyc.primitives.set_ops. 4 | 5 | #include 6 | #include "CPy.h" 7 | 8 | bool CPySet_Remove(PyObject *set, PyObject *key) { 9 | int success = PySet_Discard(set, key); 10 | if (success == 1) { 11 | return true; 12 | } 13 | if (success == 0) { 14 | _PyErr_SetKeyError(key); 15 | } 16 | return false; 17 | } 18 | -------------------------------------------------------------------------------- /mypyc/primitives/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypyc/primitives/__init__.py -------------------------------------------------------------------------------- /mypyc/primitives/float_ops.py: -------------------------------------------------------------------------------- 1 | """Primitive float ops.""" 2 | 3 | from mypyc.ir.ops import ERR_MAGIC 4 | from mypyc.ir.rtypes import ( 5 | str_rprimitive, float_rprimitive 6 | ) 7 | from mypyc.primitives.registry import ( 8 | function_op 9 | ) 10 | 11 | # float(str) 12 | function_op( 13 | name='builtins.float', 14 | arg_types=[str_rprimitive], 15 | return_type=float_rprimitive, 16 | c_function_name='PyFloat_FromString', 17 | error_kind=ERR_MAGIC) 18 | 19 | # abs(float) 20 | function_op( 21 | name='builtins.abs', 22 | arg_types=[float_rprimitive], 23 | return_type=float_rprimitive, 24 | c_function_name='PyNumber_Absolute', 25 | error_kind=ERR_MAGIC) 26 | -------------------------------------------------------------------------------- /mypyc/test-data/irbuild-strip-asserts.test: -------------------------------------------------------------------------------- 1 | [case testStripAssert1] 2 | def g(): 3 | x = 1 + 2 4 | assert x < 5 5 | return x 6 | [out] 7 | def g(): 8 | r0 :: int 9 | r1, x :: object 10 | L0: 11 | r0 = CPyTagged_Add(2, 4) 12 | r1 = box(int, r0) 13 | x = r1 14 | return x 15 | 16 | -------------------------------------------------------------------------------- /mypyc/test-data/run-floats.test: -------------------------------------------------------------------------------- 1 | [case testStrToFloat] 2 | def str_to_float(x: str) -> float: 3 | return float(x) 4 | 5 | [file driver.py] 6 | from native import str_to_float 7 | 8 | assert str_to_float("1") == 1.0 9 | assert str_to_float("1.234567") == 1.234567 10 | assert str_to_float("44324") == 44324.0 11 | assert str_to_float("23.4") == 23.4 12 | assert str_to_float("-43.44e-4") == -43.44e-4 13 | 14 | [case testFloatAbs] 15 | def test_abs() -> None: 16 | assert abs(0.0) == 0.0 17 | assert abs(-1.234567) == 1.234567 18 | assert abs(44324.732) == 44324.732 19 | assert abs(-23.4) == 23.4 20 | assert abs(-43.44e-4) == 43.44e-4 21 | -------------------------------------------------------------------------------- /mypyc/test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypyc/test/__init__.py -------------------------------------------------------------------------------- /mypyc/test/config.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | this_file_dir = os.path.dirname(os.path.realpath(__file__)) 4 | prefix = os.path.dirname(os.path.dirname(this_file_dir)) 5 | 6 | # Locations of test data files such as test case descriptions (.test). 7 | test_data_prefix = os.path.join(prefix, 'mypyc', 'test-data') 8 | -------------------------------------------------------------------------------- /mypyc/transform/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/mypyc/transform/__init__.py -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "setuptools >= 40.6.2", 4 | "wheel >= 0.30.0", 5 | ] 6 | build-backend = "setuptools.build_meta" 7 | -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/baz.pth: -------------------------------------------------------------------------------- 1 | baz 2 | -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/baz/baz_pkg/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder-site-packages/baz/baz_pkg/__init__.py -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/baz/baz_pkg/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder-site-packages/baz/baz_pkg/py.typed -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/baz/ns_baz_pkg/a.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder-site-packages/baz/ns_baz_pkg/a.py -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/baz/ns_baz_pkg/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder-site-packages/baz/ns_baz_pkg/py.typed -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/dne.pth: -------------------------------------------------------------------------------- 1 | ../does_not_exist 2 | -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/foo-stubs/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder-site-packages/foo-stubs/__init__.pyi -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/foo-stubs/bar.pyi: -------------------------------------------------------------------------------- 1 | bar_var: str -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/foo/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder-site-packages/foo/__init__.py -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/foo/bar.py: -------------------------------------------------------------------------------- 1 | bar_var = "bar" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/ignored.pth: -------------------------------------------------------------------------------- 1 | # Includes comment lines and 2 | import statements 3 | # That are ignored by the .pth parser 4 | -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/neighbor.pth: -------------------------------------------------------------------------------- 1 | ../modulefinder-src 2 | -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/ns_pkg_typed/a.py: -------------------------------------------------------------------------------- 1 | a_var = "a" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/ns_pkg_typed/b/c.py: -------------------------------------------------------------------------------- 1 | c_var = "c" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/ns_pkg_typed/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder-site-packages/ns_pkg_typed/py.typed -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/ns_pkg_untyped/a.py: -------------------------------------------------------------------------------- 1 | a_var = "a" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/ns_pkg_untyped/b/c.py: -------------------------------------------------------------------------------- 1 | c_var = "c" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/pkg_typed/__init__.py: -------------------------------------------------------------------------------- 1 | pkg_typed_var = "pkg_typed" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/pkg_typed/a.py: -------------------------------------------------------------------------------- 1 | a_var = "a" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/pkg_typed/b/__init__.py: -------------------------------------------------------------------------------- 1 | b_var = "b" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/pkg_typed/b/c.py: -------------------------------------------------------------------------------- 1 | c_var = "c" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/pkg_typed/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder-site-packages/pkg_typed/py.typed -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/pkg_untyped/__init__.py: -------------------------------------------------------------------------------- 1 | pkg_untyped_var = "pkg_untyped" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/pkg_untyped/a.py: -------------------------------------------------------------------------------- 1 | a_var = "a" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/pkg_untyped/b/__init__.py: -------------------------------------------------------------------------------- 1 | b_var = "b" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/pkg_untyped/b/c.py: -------------------------------------------------------------------------------- 1 | c_var = "c" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-site-packages/standalone.py: -------------------------------------------------------------------------------- 1 | standalone_var = "standalone" -------------------------------------------------------------------------------- /test-data/packages/modulefinder-src/neighbor_pkg/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder-src/neighbor_pkg/__init__.py -------------------------------------------------------------------------------- /test-data/packages/modulefinder-src/neighbor_pkg/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder-src/neighbor_pkg/py.typed -------------------------------------------------------------------------------- /test-data/packages/modulefinder-src/ns_neighbor_pkg/a.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder-src/ns_neighbor_pkg/a.py -------------------------------------------------------------------------------- /test-data/packages/modulefinder-src/ns_neighbor_pkg/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder-src/ns_neighbor_pkg/py.typed -------------------------------------------------------------------------------- /test-data/packages/modulefinder/nsx-pkg1/nsx/a/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder/nsx-pkg1/nsx/a/__init__.py -------------------------------------------------------------------------------- /test-data/packages/modulefinder/nsx-pkg2/nsx/b/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder/nsx-pkg2/nsx/b/__init__.py -------------------------------------------------------------------------------- /test-data/packages/modulefinder/nsx-pkg3/nsx/c/c.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder/nsx-pkg3/nsx/c/c.py -------------------------------------------------------------------------------- /test-data/packages/modulefinder/nsy-pkg1/nsy/a/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder/nsy-pkg1/nsy/a/__init__.py -------------------------------------------------------------------------------- /test-data/packages/modulefinder/nsy-pkg1/nsy/a/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder/nsy-pkg1/nsy/a/__init__.pyi -------------------------------------------------------------------------------- /test-data/packages/modulefinder/nsy-pkg2/nsy/b.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder/nsy-pkg2/nsy/b.pyi -------------------------------------------------------------------------------- /test-data/packages/modulefinder/nsy-pkg2/nsy/b/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder/nsy-pkg2/nsy/b/__init__.py -------------------------------------------------------------------------------- /test-data/packages/modulefinder/nsy-pkg2/nsy/c.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder/nsy-pkg2/nsy/c.py -------------------------------------------------------------------------------- /test-data/packages/modulefinder/nsy-pkg2/nsy/c.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder/nsy-pkg2/nsy/c.pyi -------------------------------------------------------------------------------- /test-data/packages/modulefinder/pkg1/a.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder/pkg1/a.py -------------------------------------------------------------------------------- /test-data/packages/modulefinder/pkg2/b/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/modulefinder/pkg2/b/__init__.py -------------------------------------------------------------------------------- /test-data/packages/modulefinder/readme.txt: -------------------------------------------------------------------------------- 1 | Samples for testing modulefinder.FindModuleCache. 2 | 3 | Contains three packages for the `nsx` namespace, and two packages 4 | providing `a` and `b`. 5 | -------------------------------------------------------------------------------- /test-data/packages/typedpkg-stubs/setup.py: -------------------------------------------------------------------------------- 1 | """ 2 | This setup file installs packages to test mypy's PEP 561 implementation 3 | """ 4 | 5 | from distutils.core import setup 6 | 7 | setup( 8 | name='typedpkg-stubs', 9 | author="The mypy team", 10 | version='0.1', 11 | package_data={'typedpkg-stubs': ['sample.pyi', '__init__.pyi', 'py.typed']}, 12 | packages=['typedpkg-stubs'], 13 | ) 14 | -------------------------------------------------------------------------------- /test-data/packages/typedpkg-stubs/typedpkg-stubs/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/typedpkg-stubs/typedpkg-stubs/__init__.pyi -------------------------------------------------------------------------------- /test-data/packages/typedpkg-stubs/typedpkg-stubs/py.typed: -------------------------------------------------------------------------------- 1 | partial 2 | -------------------------------------------------------------------------------- /test-data/packages/typedpkg-stubs/typedpkg-stubs/sample.pyi: -------------------------------------------------------------------------------- 1 | from typing import Iterable, List 2 | def ex(a: Iterable[str]) -> List[str]: ... 3 | -------------------------------------------------------------------------------- /test-data/packages/typedpkg/setup.py: -------------------------------------------------------------------------------- 1 | """ 2 | This setup file installs packages to test mypy's PEP 561 implementation 3 | """ 4 | 5 | from setuptools import setup 6 | 7 | setup( 8 | name='typedpkg', 9 | author="The mypy team", 10 | version='0.1', 11 | package_data={'typedpkg': ['py.typed']}, 12 | packages=['typedpkg', 'typedpkg.pkg'], 13 | include_package_data=True, 14 | zip_safe=False, 15 | ) 16 | -------------------------------------------------------------------------------- /test-data/packages/typedpkg/typedpkg/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/typedpkg/typedpkg/__init__.py -------------------------------------------------------------------------------- /test-data/packages/typedpkg/typedpkg/dne.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/typedpkg/typedpkg/dne.py -------------------------------------------------------------------------------- /test-data/packages/typedpkg/typedpkg/pkg/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/typedpkg/typedpkg/pkg/__init__.py -------------------------------------------------------------------------------- /test-data/packages/typedpkg/typedpkg/pkg/aaa.py: -------------------------------------------------------------------------------- 1 | def af(a: str) -> str: 2 | return a + " nested" 3 | -------------------------------------------------------------------------------- /test-data/packages/typedpkg/typedpkg/pkg/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/typedpkg/typedpkg/pkg/py.typed -------------------------------------------------------------------------------- /test-data/packages/typedpkg/typedpkg/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/typedpkg/typedpkg/py.typed -------------------------------------------------------------------------------- /test-data/packages/typedpkg/typedpkg/sample.py: -------------------------------------------------------------------------------- 1 | from typing import Iterable, Tuple 2 | 3 | 4 | def ex(a): 5 | # type: (Iterable[str]) -> Tuple[str, ...] 6 | """Example typed package.""" 7 | return list(a) 8 | -------------------------------------------------------------------------------- /test-data/packages/typedpkg_ns/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | setup( 4 | name='typedpkg_namespace.alpha', 5 | version='1.0.0', 6 | packages=find_packages(), 7 | namespace_packages=['typedpkg_ns'], 8 | zip_safe=False, 9 | package_data={'typedpkg_ns.ns': ['py.typed']} 10 | ) 11 | -------------------------------------------------------------------------------- /test-data/packages/typedpkg_ns/typedpkg_ns/__init__.py: -------------------------------------------------------------------------------- 1 | # namespace pkg 2 | __import__("pkg_resources").declare_namespace(__name__) 3 | -------------------------------------------------------------------------------- /test-data/packages/typedpkg_ns/typedpkg_ns/ns/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/typedpkg_ns/typedpkg_ns/ns/__init__.py -------------------------------------------------------------------------------- /test-data/packages/typedpkg_ns/typedpkg_ns/ns/bbb.py: -------------------------------------------------------------------------------- 1 | def bf(a: bool) -> bool: 2 | return not a 3 | -------------------------------------------------------------------------------- /test-data/packages/typedpkg_ns/typedpkg_ns/ns/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/packages/typedpkg_ns/typedpkg_ns/ns/py.typed -------------------------------------------------------------------------------- /test-data/samples/bottles.py: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | REFRAIN = ''' 4 | %d bottles of beer on the wall, 5 | %d bottles of beer, 6 | take one down, pass it around, 7 | %d bottles of beer on the wall! 8 | ''' 9 | bottles_of_beer = 99 10 | while bottles_of_beer > 1: 11 | print(REFRAIN % (bottles_of_beer, bottles_of_beer, 12 | bottles_of_beer - 1)) 13 | bottles_of_beer -= 1 14 | -------------------------------------------------------------------------------- /test-data/samples/class.py: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | 4 | class BankAccount(object): 5 | def __init__(self, initial_balance: int = 0) -> None: 6 | self.balance = initial_balance 7 | 8 | def deposit(self, amount: int) -> None: 9 | self.balance += amount 10 | 11 | def withdraw(self, amount: int) -> None: 12 | self.balance -= amount 13 | 14 | def overdrawn(self) -> bool: 15 | return self.balance < 0 16 | my_account = BankAccount(15) 17 | my_account.withdraw(5) 18 | print(my_account.balance) 19 | -------------------------------------------------------------------------------- /test-data/samples/cmdline.py: -------------------------------------------------------------------------------- 1 | # This program adds up integers in the command line 2 | import sys 3 | import typing 4 | try: 5 | total = sum(int(arg) for arg in sys.argv[1:]) 6 | print('sum =', total) 7 | except ValueError: 8 | print('Please supply integer arguments') 9 | -------------------------------------------------------------------------------- /test-data/samples/dict.py: -------------------------------------------------------------------------------- 1 | import typing 2 | prices = {'apple': 0.40, 'banana': 0.50} 3 | my_purchase = { 4 | 'apple': 1, 5 | 'banana': 6} 6 | grocery_bill = sum(prices[fruit] * my_purchase[fruit] 7 | for fruit in my_purchase) 8 | print('I owe the grocer $%.2f' % grocery_bill) 9 | -------------------------------------------------------------------------------- /test-data/samples/fib.py: -------------------------------------------------------------------------------- 1 | import typing 2 | parents, babies = (1, 1) 3 | while babies < 100: 4 | print('This generation has {0} babies'.format(babies)) 5 | parents, babies = (babies, parents + babies) 6 | -------------------------------------------------------------------------------- /test-data/samples/files.py: -------------------------------------------------------------------------------- 1 | # indent your Python code to put into an email 2 | import glob 3 | import typing 4 | # glob supports Unix style pathname extensions 5 | python_files = glob.glob('*.py') 6 | for file_name in sorted(python_files): 7 | print(' ------' + file_name) 8 | 9 | f = open(file_name) 10 | for line in f: 11 | print(' ' + line.rstrip()) 12 | f.close() 13 | 14 | print() 15 | -------------------------------------------------------------------------------- /test-data/samples/for.py: -------------------------------------------------------------------------------- 1 | import typing 2 | friends = ['john', 'pat', 'gary', 'michael'] 3 | for i, name in enumerate(friends): 4 | print("iteration {iteration} is {name}".format(iteration=i, name=name)) 5 | -------------------------------------------------------------------------------- /test-data/samples/generators.py: -------------------------------------------------------------------------------- 1 | # Prime number sieve with generators 2 | 3 | import itertools 4 | from typing import Iterator 5 | 6 | 7 | def iter_primes() -> Iterator[int]: 8 | # an iterator of all numbers between 2 and +infinity 9 | numbers = itertools.count(2) 10 | 11 | # generate primes forever 12 | while True: 13 | # get the first number from the iterator (always a prime) 14 | prime = next(numbers) 15 | yield prime 16 | 17 | # this code iteratively builds up a chain of 18 | # filters...slightly tricky, but ponder it a bit 19 | numbers = filter(prime.__rmod__, numbers) 20 | 21 | for p in iter_primes(): 22 | if p > 1000: 23 | break 24 | print(p) 25 | -------------------------------------------------------------------------------- /test-data/samples/greet.py: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | 4 | def greet(name: str) -> None: 5 | print('Hello', name) 6 | greet('Jack') 7 | greet('Jill') 8 | greet('Bob') 9 | -------------------------------------------------------------------------------- /test-data/samples/hello.py: -------------------------------------------------------------------------------- 1 | import typing 2 | print('Hello, world') 3 | -------------------------------------------------------------------------------- /test-data/samples/input.py: -------------------------------------------------------------------------------- 1 | import typing 2 | name = input('What is your name?\n') 3 | print('Hi, %s.' % name) 4 | -------------------------------------------------------------------------------- /test-data/samples/itertool.py: -------------------------------------------------------------------------------- 1 | from itertools import groupby 2 | import typing 3 | lines = ''' 4 | This is the 5 | first paragraph. 6 | 7 | This is the second. 8 | '''.splitlines() 9 | # Use itertools.groupby and bool to return groups of 10 | # consecutive lines that either have content or don't. 11 | for has_chars, frags in groupby(lines, bool): 12 | if has_chars: 13 | print(' '.join(frags)) 14 | # PRINTS: 15 | # This is the first paragraph. 16 | # This is the second. 17 | -------------------------------------------------------------------------------- /test-data/samples/readme.txt: -------------------------------------------------------------------------------- 1 | Mypy Sample Programs 2 | -------------------- 3 | 4 | The sample programs use static typing unless otherwise noted in comments. 5 | 6 | Original credits for sample programs: 7 | 8 | fib.py - Python Wiki [1] 9 | for.py - Python Wiki [1] 10 | greet.py - Python Wiki [1] 11 | hello.py - Python Wiki [1] 12 | input.py - Python Wiki [1] 13 | regexp.py - Python Wiki [1] 14 | dict.py - Python Wiki [1] 15 | cmdline.py - Python Wiki [1] 16 | files.py - Python Wiki [1] 17 | bottles.py - Python Wiki [1] 18 | class.py - Python Wiki [1] 19 | guess.py - Python Wiki [1] 20 | generators.py - Python Wiki [1] 21 | itertool.py - Python Wiki [1] 22 | 23 | The sample programs were ported to mypy by Jukka Lehtosalo. 24 | 25 | [1] http://wiki.python.org/moin/SimplePrograms 26 | -------------------------------------------------------------------------------- /test-data/samples/regexp.py: -------------------------------------------------------------------------------- 1 | import typing 2 | import re 3 | for test_string in ['555-1212', 'ILL-EGAL']: 4 | if re.match(r'^\d{3}-\d{4}$', test_string): 5 | print(test_string, 'is a valid US local phone number') 6 | else: 7 | print(test_string, 'rejected') 8 | -------------------------------------------------------------------------------- /test-data/stdlib-samples/3.2/test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/stdlib-samples/3.2/test/__init__.py -------------------------------------------------------------------------------- /test-data/stdlib-samples/3.2/test/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | mypy_path = .. 3 | -------------------------------------------------------------------------------- /test-data/stdlib-samples/3.2/test/subprocessdata/fd_status.py: -------------------------------------------------------------------------------- 1 | """When called as a script, print a comma-separated list of the open 2 | file descriptors on stdout.""" 3 | 4 | import errno 5 | import os 6 | 7 | try: 8 | _MAXFD = os.sysconf("SC_OPEN_MAX") 9 | except: 10 | _MAXFD = 256 11 | 12 | if __name__ == "__main__": 13 | fds = [] 14 | for fd in range(0, _MAXFD): 15 | try: 16 | st = os.fstat(fd) 17 | except OSError as e: 18 | if e.errno == errno.EBADF: 19 | continue 20 | raise 21 | # Ignore Solaris door files 22 | if st.st_mode & 0xF000 != 0xd000: 23 | fds.append(fd) 24 | print(','.join(map(str, fds))) 25 | -------------------------------------------------------------------------------- /test-data/stdlib-samples/3.2/test/subprocessdata/input_reader.py: -------------------------------------------------------------------------------- 1 | """When called as a script, consumes the input""" 2 | 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | for line in sys.stdin: 7 | pass 8 | -------------------------------------------------------------------------------- /test-data/stdlib-samples/3.2/test/subprocessdata/qcat.py: -------------------------------------------------------------------------------- 1 | """When ran as a script, simulates cat with no arguments.""" 2 | 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | for line in sys.stdin: 7 | sys.stdout.write(line) 8 | -------------------------------------------------------------------------------- /test-data/stdlib-samples/3.2/test/subprocessdata/qgrep.py: -------------------------------------------------------------------------------- 1 | """When called with a single argument, simulated fgrep with a single 2 | argument and no options.""" 3 | 4 | import sys 5 | 6 | if __name__ == "__main__": 7 | pattern = sys.argv[1] 8 | for line in sys.stdin: 9 | if pattern in line: 10 | sys.stdout.write(line) 11 | -------------------------------------------------------------------------------- /test-data/stdlib-samples/3.2/test/subprocessdata/sigchild_ignore.py: -------------------------------------------------------------------------------- 1 | import signal, subprocess, sys 2 | # On Linux this causes os.waitpid to fail with OSError as the OS has already 3 | # reaped our child process. The wait() passing the OSError on to the caller 4 | # and causing us to exit with an error is what we are testing against. 5 | signal.signal(signal.SIGCHLD, signal.SIG_IGN) 6 | subprocess.Popen([sys.executable, '-c', 'print("albatross")']).wait() 7 | -------------------------------------------------------------------------------- /test-data/stdlib-samples/3.2/test/tf_inherit_check.py: -------------------------------------------------------------------------------- 1 | # Helper script for test_tempfile.py. argv[2] is the number of a file 2 | # descriptor which should _not_ be open. Check this by attempting to 3 | # write to it -- if we succeed, something is wrong. 4 | 5 | import sys 6 | import os 7 | 8 | verbose = (sys.argv[1] == 'v') 9 | try: 10 | fd = int(sys.argv[2]) 11 | 12 | try: 13 | os.write(fd, b"blat") 14 | except os.error: 15 | # Success -- could not write to fd. 16 | sys.exit(0) 17 | else: 18 | if verbose: 19 | sys.stderr.write("fd %d is open in child" % fd) 20 | sys.exit(1) 21 | 22 | except Exception: 23 | if verbose: 24 | raise 25 | sys.exit(1) 26 | -------------------------------------------------------------------------------- /test-data/stubgen/pybind11_mypy_demo/__init__.pyi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamirPaulb/mypy/ac66403cb4374b858786350b96e7f5972db84bcd/test-data/stubgen/pybind11_mypy_demo/__init__.pyi -------------------------------------------------------------------------------- /test-data/unit/check-python39.test: -------------------------------------------------------------------------------- 1 | [case testGivingSameKeywordArgumentTwice] 2 | # This test was originally in check-kwargs.test 3 | # Python 3.9's new parser started producing a different error message here. Since this isn't the 4 | # most important test, to deal with this we'll only run this test with Python 3.9 and later. 5 | import typing 6 | def f(a: 'A', b: 'B') -> None: pass 7 | f(a=A(), b=B(), a=A()) # E: "f" gets multiple values for keyword argument "a" 8 | class A: pass 9 | class B: pass 10 | 11 | 12 | [case testPEP614] 13 | from typing import Callable, List 14 | 15 | decorator_list: List[Callable[..., Callable[[int], str]]] 16 | @decorator_list[0] 17 | def f(x: float) -> float: ... 18 | reveal_type(f) # N: Revealed type is 'def (builtins.int) -> builtins.str' 19 | [builtins fixtures/list.pyi] 20 | -------------------------------------------------------------------------------- /test-data/unit/check-underscores.test: -------------------------------------------------------------------------------- 1 | [case testUnderscoresRequire36] 2 | # flags: --python-version 3.5 3 | x = 1000_000 # E: Underscores in numeric literals are only supported in Python 3.6 and greater 4 | [out] 5 | 6 | [case testUnderscoresBasics] 7 | # flags: --python-version 3.6 8 | x: int 9 | x = 1000_000 10 | x = 0x_FF_FF_FF_FF 11 | y: str = 1000_000.000_001 # E: Incompatible types in assignment (expression has type "float", variable has type "str") 12 | -------------------------------------------------------------------------------- /test-data/unit/check-unsupported.test: -------------------------------------------------------------------------------- 1 | -- Tests for unsupported features 2 | 3 | 4 | [case testDecorateOverloadedFunction] 5 | from foo import * 6 | [file foo.pyi] 7 | # The error messages are not the most informative ever. 8 | def d(x): pass 9 | @d 10 | def f(): pass 11 | def f(x): pass # E 12 | def g(): pass 13 | @d # E 14 | def g(x): pass 15 | [out] 16 | tmp/foo.pyi:5: error: Name 'f' already defined on line 3 17 | tmp/foo.pyi:7: error: Name 'g' already defined on line 6 18 | -------------------------------------------------------------------------------- /test-data/unit/envvars.test: -------------------------------------------------------------------------------- 1 | # Test cases related to environment variables 2 | [case testEnvvar_MYPY_CONFIG_FILE_DIR] 3 | # cmd: mypy --config-file=subdir/mypy.ini 4 | [file bogus.py] 5 | FOO = 'x' # type: int 6 | [file subdir/good.py] 7 | BAR = 0 # type: int 8 | [file subdir/mypy.ini] 9 | \[mypy] 10 | files=$MYPY_CONFIG_FILE_DIR/good.py 11 | 12 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/__init_subclass__.pyi: -------------------------------------------------------------------------------- 1 | # builtins stub with object.__init_subclass__ 2 | 3 | class object: 4 | def __init_subclass__(cls) -> None: pass 5 | 6 | class type: pass 7 | 8 | class int: pass 9 | class bool: pass 10 | class str: pass 11 | class function: pass 12 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/__new__.pyi: -------------------------------------------------------------------------------- 1 | # builtins stub with object.__new__ 2 | 3 | from typing import Any 4 | 5 | class object: 6 | def __init__(self) -> None: pass 7 | 8 | __class__ = object 9 | 10 | def __new__(cls) -> Any: pass 11 | 12 | class type: 13 | def __init__(self, x) -> None: pass 14 | 15 | class int: pass 16 | class bool: pass 17 | class str: pass 18 | class function: pass 19 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/alias.pyi: -------------------------------------------------------------------------------- 1 | # Builtins test fixture with a type alias 'bytes' 2 | 3 | class object: 4 | def __init__(self) -> None: pass 5 | class type: 6 | def __init__(self, x) -> None: pass 7 | 8 | class int: pass 9 | class str: pass 10 | class function: pass 11 | 12 | bytes = str 13 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/bool.pyi: -------------------------------------------------------------------------------- 1 | # builtins stub used in boolean-related test cases. 2 | from typing import Generic, TypeVar 3 | T = TypeVar('T') 4 | 5 | class object: 6 | def __init__(self) -> None: pass 7 | def __eq__(self, other: object) -> bool: pass 8 | def __ne__(self, other: object) -> bool: pass 9 | 10 | class type: pass 11 | class tuple(Generic[T]): pass 12 | class function: pass 13 | class bool: pass 14 | class int: pass 15 | class float: pass 16 | class str: pass 17 | class unicode: pass 18 | class ellipsis: pass 19 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/bool_py2.pyi: -------------------------------------------------------------------------------- 1 | # builtins stub used in boolean-related test cases. 2 | from typing import Generic, TypeVar 3 | import sys 4 | T = TypeVar('T') 5 | 6 | class object: 7 | def __init__(self) -> None: pass 8 | 9 | class type: pass 10 | class tuple(Generic[T]): pass 11 | class function: pass 12 | class bool: pass 13 | class int: pass 14 | class str: pass 15 | class unicode: pass 16 | class ellipsis: pass 17 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/callable.pyi: -------------------------------------------------------------------------------- 1 | from typing import Generic, Tuple, TypeVar, Union 2 | 3 | T = TypeVar('T') 4 | 5 | class object: 6 | def __init__(self) -> None: pass 7 | 8 | class type: 9 | def __init__(self, x) -> None: pass 10 | 11 | class tuple(Generic[T]): pass 12 | 13 | class function: pass 14 | 15 | def isinstance(x: object, t: Union[type, Tuple[type, ...]]) -> bool: pass 16 | 17 | def callable(x: object) -> bool: pass 18 | 19 | class int: 20 | def __add__(self, other: 'int') -> 'int': pass 21 | def __eq__(self, other: 'int') -> 'bool': pass 22 | class float: pass 23 | class bool(int): pass 24 | class str: 25 | def __add__(self, other: 'str') -> 'str': pass 26 | def __eq__(self, other: 'str') -> bool: pass 27 | class ellipsis: pass 28 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/classmethod.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | _T = typing.TypeVar('_T') 4 | 5 | class object: 6 | def __init__(self) -> None: pass 7 | 8 | class type: 9 | def __init__(self, x) -> None: pass 10 | def mro(self) -> typing.Any: pass 11 | 12 | class function: pass 13 | 14 | # Dummy definitions. 15 | class classmethod: pass 16 | class staticmethod: pass 17 | 18 | class int: 19 | @classmethod 20 | def from_bytes(cls, bytes: bytes, byteorder: str) -> int: pass 21 | 22 | class float: pass 23 | class str: pass 24 | class bytes: pass 25 | class bool: pass 26 | class ellipsis: pass 27 | 28 | class tuple(typing.Generic[_T]): pass 29 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/complex.pyi: -------------------------------------------------------------------------------- 1 | # Builtins stub used for some float/complex test cases. 2 | # Please don't add tuple to this file, it is used to test incomplete fixtures. 3 | 4 | class object: 5 | def __init__(self): pass 6 | 7 | class type: pass 8 | class function: pass 9 | class int: pass 10 | class float: pass 11 | class complex: pass 12 | class str: pass 13 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/complex_tuple.pyi: -------------------------------------------------------------------------------- 1 | from typing import Generic, TypeVar 2 | _T = TypeVar('_T') 3 | 4 | class object: 5 | def __init__(self): pass 6 | 7 | class tuple(Generic[_T]): pass 8 | 9 | class type: pass 10 | class function: pass 11 | class int: pass 12 | class float: pass 13 | class complex: pass 14 | class str: pass 15 | class ellipsis: pass 16 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/divmod.pyi: -------------------------------------------------------------------------------- 1 | from typing import TypeVar, Tuple, SupportsInt 2 | class object: 3 | def __init__(self): pass 4 | 5 | class int(SupportsInt): 6 | def __divmod__(self, other: int) -> Tuple[int, int]: pass 7 | def __rdivmod__(self, other: int) -> Tuple[int, int]: pass 8 | 9 | class float(SupportsInt): 10 | def __divmod__(self, other: float) -> Tuple[float, float]: pass 11 | def __rdivmod__(self, other: float) -> Tuple[float, float]: pass 12 | 13 | 14 | class tuple: pass 15 | class function: pass 16 | class str: pass 17 | class type: pass 18 | class ellipsis: pass 19 | 20 | _N = TypeVar('_N', int, float) 21 | def divmod(_x: _N, _y: _N) -> Tuple[_N, _N]: ... 22 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/exception.pyi: -------------------------------------------------------------------------------- 1 | from typing import Generic, TypeVar 2 | T = TypeVar('T') 3 | 4 | class object: 5 | def __init__(self): pass 6 | 7 | class type: pass 8 | class tuple(Generic[T]): pass 9 | class function: pass 10 | class int: pass 11 | class str: pass 12 | class unicode: pass 13 | class bool: pass 14 | class ellipsis: pass 15 | 16 | # Note: this is a slight simplification. In Python 2, the inheritance hierarchy 17 | # is actually Exception -> StandardError -> RuntimeError -> ... 18 | class BaseException: 19 | def __init__(self, *args: object) -> None: ... 20 | class Exception(BaseException): pass 21 | class RuntimeError(Exception): pass 22 | class NotImplementedError(RuntimeError): pass 23 | 24 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/fine_grained.pyi: -------------------------------------------------------------------------------- 1 | # Small stub for fine-grained incremental checking test cases 2 | # 3 | # TODO: Migrate to regular stubs once fine-grained incremental is robust 4 | # enough to handle them. 5 | 6 | import types 7 | from typing import TypeVar, Generic 8 | 9 | T = TypeVar('T') 10 | 11 | class Any: pass 12 | 13 | class object: 14 | def __init__(self) -> None: pass 15 | 16 | class type: 17 | def __init__(self, x: Any) -> None: pass 18 | 19 | class int: 20 | def __add__(self, other: 'int') -> 'int': pass 21 | class str: 22 | def __add__(self, other: 'str') -> 'str': pass 23 | 24 | class float: pass 25 | class bytes: pass 26 | class tuple(Generic[T]): pass 27 | class function: pass 28 | class ellipsis: pass 29 | class list(Generic[T]): pass 30 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/for.pyi: -------------------------------------------------------------------------------- 1 | # builtins stub used in for statement test cases 2 | 3 | from typing import TypeVar, Generic, Iterable, Iterator, Generator 4 | from abc import abstractmethod, ABCMeta 5 | 6 | t = TypeVar('t') 7 | 8 | class object: 9 | def __init__(self) -> None: pass 10 | 11 | class type: pass 12 | class tuple(Generic[t]): 13 | def __iter__(self) -> Iterator[t]: pass 14 | class function: pass 15 | class bool: pass 16 | class int: pass # for convenience 17 | class str: pass # for convenience 18 | 19 | class list(Iterable[t], Generic[t]): 20 | def __iter__(self) -> Iterator[t]: pass 21 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/function.pyi: -------------------------------------------------------------------------------- 1 | class object: 2 | def __init__(self): pass 3 | 4 | class type: pass 5 | class function: pass 6 | class int: pass 7 | class str: pass 8 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/isinstance.pyi: -------------------------------------------------------------------------------- 1 | from typing import Tuple, TypeVar, Generic, Union, cast, Any, Type 2 | 3 | T = TypeVar('T') 4 | 5 | class object: 6 | def __init__(self) -> None: pass 7 | 8 | class type: 9 | def __init__(self, x) -> None: pass 10 | 11 | class tuple(Generic[T]): pass 12 | 13 | class function: pass 14 | 15 | def isinstance(x: object, t: Union[Type[object], Tuple[Type[object], ...]]) -> bool: pass 16 | def issubclass(x: object, t: Union[Type[object], Tuple[Type[object], ...]]) -> bool: pass 17 | 18 | class int: 19 | def __add__(self, other: 'int') -> 'int': pass 20 | class float: pass 21 | class bool(int): pass 22 | class str: 23 | def __add__(self, other: 'str') -> 'str': pass 24 | class ellipsis: pass 25 | 26 | NotImplemented = cast(Any, None) 27 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/module.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, Generic, TypeVar, Sequence 2 | from types import ModuleType 3 | 4 | T = TypeVar('T') 5 | S = TypeVar('S') 6 | 7 | class list(Generic[T], Sequence[T]): pass 8 | 9 | class object: 10 | def __init__(self) -> None: pass 11 | class type: pass 12 | class function: pass 13 | class int: pass 14 | class str: pass 15 | class bool: pass 16 | class tuple(Generic[T]): pass 17 | class dict(Generic[T, S]): pass 18 | class ellipsis: pass 19 | 20 | classmethod = object() 21 | staticmethod = object() 22 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/module_all.pyi: -------------------------------------------------------------------------------- 1 | from typing import Generic, Sequence, TypeVar 2 | from types import ModuleType 3 | 4 | _T = TypeVar('_T') 5 | 6 | class object: 7 | def __init__(self) -> None: pass 8 | class type: pass 9 | class function: pass 10 | class int: pass 11 | class str: pass 12 | class bool: pass 13 | class list(Generic[_T], Sequence[_T]): 14 | def append(self, x: _T): pass 15 | def extend(self, x: Sequence[_T]): pass 16 | def __add__(self, rhs: Sequence[_T]) -> list[_T]: pass 17 | class tuple(Generic[_T]): pass 18 | class ellipsis: pass 19 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/module_all_python2.pyi: -------------------------------------------------------------------------------- 1 | from typing import Generic, Sequence, TypeVar 2 | _T = TypeVar('_T') 3 | 4 | class object: 5 | def __init__(self) -> None: pass 6 | class type: pass 7 | class function: pass 8 | class int: pass 9 | class str: pass 10 | class unicode: pass 11 | class list(Generic[_T], Sequence[_T]): 12 | def append(self, x: _T): pass 13 | def extend(self, x: Sequence[_T]): pass 14 | def __add__(self, rhs: Sequence[_T]) -> list[_T]: pass 15 | class tuple(Generic[_T]): pass 16 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/notimplemented.pyi: -------------------------------------------------------------------------------- 1 | # builtins stub used in NotImplemented related cases. 2 | from typing import Any, cast 3 | 4 | 5 | class object: 6 | def __init__(self) -> None: pass 7 | 8 | class type: pass 9 | class function: pass 10 | class bool: pass 11 | class int: pass 12 | class str: pass 13 | NotImplemented = cast(Any, None) 14 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/property.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | _T = typing.TypeVar('_T') 4 | 5 | class object: 6 | def __init__(self) -> None: pass 7 | 8 | class type: 9 | def __init__(self, x: typing.Any) -> None: pass 10 | 11 | class function: pass 12 | 13 | property = object() # Dummy definition 14 | 15 | class int: pass 16 | class str: pass 17 | class bytes: pass 18 | class bool: pass 19 | class ellipsis: pass 20 | 21 | class tuple(typing.Generic[_T]): pass 22 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/property_py2.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | _T = typing.TypeVar('_T') 4 | 5 | class object: 6 | def __init__(self) -> None: pass 7 | 8 | class type: 9 | def __init__(self, x: typing.Any) -> None: pass 10 | 11 | class function: pass 12 | 13 | property = object() # Dummy definition 14 | 15 | class int: pass 16 | class str: pass 17 | class unicode: pass 18 | class bool: pass 19 | class ellipsis: pass 20 | 21 | class tuple(typing.Generic[_T]): pass 22 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/set.pyi: -------------------------------------------------------------------------------- 1 | # Builtins stub used in set-related test cases. 2 | 3 | from typing import TypeVar, Generic, Iterator, Iterable, Set 4 | 5 | T = TypeVar('T') 6 | 7 | class object: 8 | def __init__(self) -> None: pass 9 | 10 | class type: pass 11 | class tuple(Generic[T]): pass 12 | class function: pass 13 | 14 | class int: pass 15 | class str: pass 16 | class bool: pass 17 | class ellipsis: pass 18 | 19 | class set(Iterable[T], Generic[T]): 20 | def __iter__(self) -> Iterator[T]: pass 21 | def __contains__(self, item: object) -> bool: pass 22 | def __ior__(self, x: Set[T]) -> None: pass 23 | def add(self, x: T) -> None: pass 24 | def discard(self, x: T) -> None: pass 25 | def update(self, x: Set[T]) -> None: pass 26 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/slice.pyi: -------------------------------------------------------------------------------- 1 | # Builtins stub used in slicing test cases. 2 | from typing import Generic, TypeVar 3 | T = TypeVar('T') 4 | 5 | class object: 6 | def __init__(self): pass 7 | 8 | class type: pass 9 | class tuple(Generic[T]): pass 10 | class function: pass 11 | 12 | class int: pass 13 | class str: pass 14 | 15 | class slice: pass 16 | class ellipsis: pass 17 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/staticmethod.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | class object: 4 | def __init__(self) -> None: pass 5 | 6 | class type: 7 | def __init__(self, x) -> None: pass 8 | 9 | class function: pass 10 | 11 | staticmethod = object() # Dummy definition. 12 | property = object() # Dummy definition 13 | 14 | class int: 15 | @staticmethod 16 | def from_bytes(bytes: bytes, byteorder: str) -> int: pass 17 | 18 | class str: pass 19 | class unicode: pass 20 | class bytes: pass 21 | class ellipsis: pass 22 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/tuple-simple.pyi: -------------------------------------------------------------------------------- 1 | # Builtins stub used in some tuple-related test cases. 2 | # 3 | # This is a simpler version of tuple.py which is useful 4 | # and makes some test cases easier to write/debug. 5 | 6 | from typing import Iterable, TypeVar, Generic 7 | 8 | T = TypeVar('T') 9 | 10 | class object: 11 | def __init__(self): pass 12 | 13 | class type: pass 14 | class tuple(Generic[T]): 15 | def __getitem__(self, x: int) -> T: pass 16 | class function: pass 17 | 18 | # We need int for indexing tuples. 19 | class int: pass 20 | class str: pass # For convenience 21 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/type.pyi: -------------------------------------------------------------------------------- 1 | # builtins stub used in type-related test cases. 2 | 3 | from typing import Generic, TypeVar, List 4 | 5 | T = TypeVar('T') 6 | 7 | class object: 8 | def __init__(self) -> None: pass 9 | def __str__(self) -> 'str': pass 10 | 11 | class list(Generic[T]): pass 12 | 13 | class type: 14 | __name__: str 15 | def mro(self) -> List['type']: pass 16 | 17 | class tuple(Generic[T]): pass 18 | class function: pass 19 | class bool: pass 20 | class int: pass 21 | class str: pass 22 | class unicode: pass 23 | -------------------------------------------------------------------------------- /test-data/unit/fixtures/union.pyi: -------------------------------------------------------------------------------- 1 | # Builtins stub used in tuple-related test cases. 2 | 3 | from isinstance import isinstance 4 | from typing import Iterable, TypeVar, Generic 5 | T = TypeVar('T') 6 | 7 | class object: 8 | def __init__(self): pass 9 | 10 | class type: pass 11 | class function: pass 12 | 13 | class tuple(Generic[T]): pass 14 | 15 | # We need int for indexing tuples. 16 | class int: pass 17 | class str: pass # For convenience 18 | -------------------------------------------------------------------------------- /test-data/unit/lib-stub/__builtin__.pyi: -------------------------------------------------------------------------------- 1 | from typing import Generic, TypeVar 2 | _T = TypeVar('_T') 3 | 4 | Any = 0 5 | 6 | class object: 7 | def __init__(self): 8 | # type: () -> None 9 | pass 10 | 11 | class type: 12 | def __init__(self, x): 13 | # type: (Any) -> None 14 | pass 15 | 16 | # These are provided here for convenience. 17 | class int: pass 18 | class float: pass 19 | 20 | class str: pass 21 | class unicode: pass 22 | 23 | class tuple(Generic[_T]): pass 24 | class function: pass 25 | 26 | class ellipsis: pass 27 | 28 | def print(*args, end=''): pass 29 | 30 | # Definition of None is implicit 31 | -------------------------------------------------------------------------------- /test-data/unit/lib-stub/abc.pyi: -------------------------------------------------------------------------------- 1 | from typing import Type, Any, TypeVar 2 | 3 | T = TypeVar('T', bound=Type[Any]) 4 | 5 | class ABC(type): pass 6 | class ABCMeta(type): 7 | def register(cls, tp: T) -> T: pass 8 | abstractmethod = object() 9 | abstractproperty = object() 10 | -------------------------------------------------------------------------------- /test-data/unit/lib-stub/attr/converters.pyi: -------------------------------------------------------------------------------- 1 | from typing import TypeVar, Optional, Callable, overload 2 | from . import _ConverterType 3 | 4 | _T = TypeVar("_T") 5 | 6 | def optional( 7 | converter: _ConverterType[_T] 8 | ) -> _ConverterType[Optional[_T]]: ... 9 | @overload 10 | def default_if_none(default: _T) -> _ConverterType[_T]: ... 11 | @overload 12 | def default_if_none(*, factory: Callable[[], _T]) -> _ConverterType[_T]: ... 13 | -------------------------------------------------------------------------------- /test-data/unit/lib-stub/blocker.pyi: -------------------------------------------------------------------------------- 1 | # Stub file that generates a blocking parse error 2 | x y 3 | -------------------------------------------------------------------------------- /test-data/unit/lib-stub/blocker2.pyi: -------------------------------------------------------------------------------- 1 | # Stub file that generates a blocking semantic analysis error 2 | continue 3 | -------------------------------------------------------------------------------- /test-data/unit/lib-stub/broken.pyi: -------------------------------------------------------------------------------- 1 | # Stub file that generates an error 2 | x = y 3 | -------------------------------------------------------------------------------- /test-data/unit/lib-stub/builtins.pyi: -------------------------------------------------------------------------------- 1 | # DO NOT ADD TO THIS FILE AS IT WILL SLOW DOWN TESTS! 2 | # 3 | # Use [builtins fixtures/...pyi] if you need more features. 4 | 5 | class object: 6 | def __init__(self) -> None: pass 7 | 8 | class type: 9 | def __init__(self, x: object) -> None: pass 10 | 11 | # These are provided here for convenience. 12 | class int: 13 | def __add__(self, other: int) -> int: pass 14 | class float: pass 15 | 16 | class str: pass 17 | class bytes: pass 18 | 19 | class function: pass 20 | class ellipsis: pass 21 | 22 | # Definition of None is implicit 23 | -------------------------------------------------------------------------------- /test-data/unit/lib-stub/contextlib.pyi: -------------------------------------------------------------------------------- 1 | import sys 2 | from typing import Generic, TypeVar, Callable, Iterator 3 | from typing import ContextManager as ContextManager 4 | 5 | _T = TypeVar('_T') 6 | 7 | class GeneratorContextManager(ContextManager[_T], Generic[_T]): 8 | def __call__(self, func: Callable[..., _T]) -> Callable[..., _T]: ... 9 | 10 | def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., GeneratorContextManager[_T]]: 11 | ... 12 | 13 | if sys.version_info >= (3, 7): 14 | from typing import AsyncIterator 15 | from typing import AsyncContextManager as AsyncContextManager 16 | def asynccontextmanager(func: Callable[..., AsyncIterator[_T]]) -> Callable[..., AsyncContextManager[_T]]: ... 17 | -------------------------------------------------------------------------------- /test-data/unit/lib-stub/future/__init__.pyi: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, print_function 2 | -------------------------------------------------------------------------------- /test-data/unit/lib-stub/future/utils.pyi: -------------------------------------------------------------------------------- 1 | from typing import Type 2 | def with_metaclass(meta: Type[type], *bases: type) -> type: pass 3 | -------------------------------------------------------------------------------- /test-data/unit/lib-stub/six.pyi: -------------------------------------------------------------------------------- 1 | from typing import Type, Callable 2 | def with_metaclass(mcls: Type[type], *args: type) -> type: pass 3 | def add_metaclass(mcls: Type[type]) -> Callable[[type], type]: pass 4 | -------------------------------------------------------------------------------- /test-data/unit/lib-stub/sys.pyi: -------------------------------------------------------------------------------- 1 | version_info = (0, 0, 0, '', 0) 2 | platform = '' 3 | -------------------------------------------------------------------------------- /test-data/unit/lib-stub/types.pyi: -------------------------------------------------------------------------------- 1 | from typing import TypeVar 2 | 3 | _T = TypeVar('_T') 4 | 5 | def coroutine(func: _T) -> _T: pass 6 | 7 | class bool: ... 8 | 9 | class ModuleType: 10 | __file__ = ... # type: str 11 | -------------------------------------------------------------------------------- /test-data/unit/plugins/attrhook.py: -------------------------------------------------------------------------------- 1 | from typing import Optional, Callable 2 | 3 | from mypy.plugin import Plugin, AttributeContext 4 | from mypy.types import Type, Instance 5 | 6 | 7 | class AttrPlugin(Plugin): 8 | def get_attribute_hook(self, fullname: str) -> Optional[Callable[[AttributeContext], Type]]: 9 | if fullname == 'm.Signal.__call__': 10 | return signal_call_callback 11 | return None 12 | 13 | 14 | def signal_call_callback(ctx: AttributeContext) -> Type: 15 | if isinstance(ctx.type, Instance): 16 | return ctx.type.args[0] 17 | return ctx.default_attr_type 18 | 19 | 20 | def plugin(version): 21 | return AttrPlugin 22 | -------------------------------------------------------------------------------- /test-data/unit/plugins/badreturn.py: -------------------------------------------------------------------------------- 1 | def plugin(version): 2 | pass 3 | -------------------------------------------------------------------------------- /test-data/unit/plugins/badreturn2.py: -------------------------------------------------------------------------------- 1 | class MyPlugin: 2 | pass 3 | 4 | def plugin(version): 5 | return MyPlugin 6 | -------------------------------------------------------------------------------- /test-data/unit/plugins/callable_instance.py: -------------------------------------------------------------------------------- 1 | from mypy.plugin import MethodContext, Plugin 2 | from mypy.types import Instance, Type 3 | 4 | class CallableInstancePlugin(Plugin): 5 | def get_function_hook(self, fullname): 6 | assert not fullname.endswith(' of Foo') 7 | 8 | def get_method_hook(self, fullname): 9 | # Ensure that all names are fully qualified 10 | assert not fullname.endswith(' of Foo') 11 | 12 | if fullname == '__main__.Class.__call__': 13 | return my_hook 14 | 15 | return None 16 | 17 | def my_hook(ctx: MethodContext) -> Type: 18 | if isinstance(ctx.type, Instance) and len(ctx.type.args) == 1: 19 | return ctx.type.args[0] 20 | return ctx.default_return_type 21 | 22 | def plugin(version): 23 | return CallableInstancePlugin 24 | -------------------------------------------------------------------------------- /test-data/unit/plugins/config_data.py: -------------------------------------------------------------------------------- 1 | import os 2 | import json 3 | 4 | from typing import Any 5 | 6 | from mypy.plugin import Plugin, ReportConfigContext 7 | 8 | 9 | class ConfigDataPlugin(Plugin): 10 | def report_config_data(self, ctx: ReportConfigContext) -> Any: 11 | path = os.path.join('tmp/test.json') 12 | with open(path) as f: 13 | data = json.load(f) 14 | return data.get(ctx.id) 15 | 16 | 17 | def plugin(version): 18 | return ConfigDataPlugin 19 | -------------------------------------------------------------------------------- /test-data/unit/plugins/customentry.py: -------------------------------------------------------------------------------- 1 | from mypy.plugin import Plugin 2 | 3 | class MyPlugin(Plugin): 4 | def get_function_hook(self, fullname): 5 | if fullname == '__main__.f': 6 | return my_hook 7 | assert fullname is not None 8 | return None 9 | 10 | def my_hook(ctx): 11 | return ctx.api.named_generic_type('builtins.int', []) 12 | 13 | def register(version): 14 | return MyPlugin 15 | -------------------------------------------------------------------------------- /test-data/unit/plugins/customize_mro.py: -------------------------------------------------------------------------------- 1 | from mypy.plugin import Plugin 2 | 3 | class DummyPlugin(Plugin): 4 | def get_customize_class_mro_hook(self, fullname): 5 | def analyze(classdef_ctx): 6 | pass 7 | return analyze 8 | 9 | def plugin(version): 10 | return DummyPlugin 11 | -------------------------------------------------------------------------------- /test-data/unit/plugins/decimal_to_int.py: -------------------------------------------------------------------------------- 1 | import builtins 2 | from typing import Optional, Callable 3 | 4 | from mypy.plugin import Plugin, AnalyzeTypeContext 5 | from mypy.types import CallableType, Type 6 | 7 | 8 | class MyPlugin(Plugin): 9 | def get_type_analyze_hook(self, fullname): 10 | if fullname == "decimal.Decimal": 11 | return decimal_to_int_hook 12 | return None 13 | 14 | def plugin(version): 15 | return MyPlugin 16 | 17 | def decimal_to_int_hook(ctx): 18 | return ctx.api.named_type('builtins.int', []) 19 | -------------------------------------------------------------------------------- /test-data/unit/plugins/depshook.py: -------------------------------------------------------------------------------- 1 | from typing import Optional, Callable, List, Tuple 2 | 3 | from mypy.plugin import Plugin 4 | from mypy.nodes import MypyFile 5 | 6 | 7 | class DepsPlugin(Plugin): 8 | def get_additional_deps(self, file: MypyFile) -> List[Tuple[int, str, int]]: 9 | if file.fullname == '__main__': 10 | return [(10, 'err', -1)] 11 | return [] 12 | 13 | 14 | def plugin(version): 15 | return DepsPlugin 16 | -------------------------------------------------------------------------------- /test-data/unit/plugins/fnplugin.py: -------------------------------------------------------------------------------- 1 | from mypy.plugin import Plugin 2 | 3 | class MyPlugin(Plugin): 4 | def get_function_hook(self, fullname): 5 | if fullname == '__main__.f': 6 | return my_hook 7 | assert fullname is not None 8 | return None 9 | 10 | def my_hook(ctx): 11 | return ctx.api.named_generic_type('builtins.int', []) 12 | 13 | def plugin(version): 14 | return MyPlugin 15 | -------------------------------------------------------------------------------- /test-data/unit/plugins/fully_qualified_test_hook.py: -------------------------------------------------------------------------------- 1 | from mypy.plugin import CallableType, MethodSigContext, Plugin 2 | 3 | class FullyQualifiedTestPlugin(Plugin): 4 | def get_method_signature_hook(self, fullname): 5 | # Ensure that all names are fully qualified 6 | if 'FullyQualifiedTest' in fullname: 7 | assert fullname.startswith('__main__.') and not ' of ' in fullname, fullname 8 | return my_hook 9 | 10 | return None 11 | 12 | def my_hook(ctx: MethodSigContext) -> CallableType: 13 | return ctx.default_signature.copy_modified(ret_type=ctx.api.named_generic_type('builtins.int', [])) 14 | 15 | def plugin(version): 16 | return FullyQualifiedTestPlugin 17 | -------------------------------------------------------------------------------- /test-data/unit/plugins/noentry.py: -------------------------------------------------------------------------------- 1 | # empty plugin 2 | -------------------------------------------------------------------------------- /test-data/unit/plugins/plugin2.py: -------------------------------------------------------------------------------- 1 | from mypy.plugin import Plugin 2 | 3 | class Plugin2(Plugin): 4 | def get_function_hook(self, fullname): 5 | if fullname in ('__main__.f', '__main__.g'): 6 | return str_hook 7 | return None 8 | 9 | def str_hook(ctx): 10 | return ctx.api.named_generic_type('builtins.str', []) 11 | 12 | def plugin(version): 13 | return Plugin2 14 | -------------------------------------------------------------------------------- /test-data/unit/semenal-literal.test: -------------------------------------------------------------------------------- 1 | [case testLiteralSemanalBasicAssignment] 2 | from typing_extensions import Literal 3 | foo: Literal[3] 4 | [out] 5 | MypyFile:1( 6 | ImportFrom:1(typing_extensions, [Literal]) 7 | AssignmentStmt:2( 8 | NameExpr(foo [__main__.foo]) 9 | TempNode:2( 10 | Any) 11 | Literal[3])) 12 | 13 | [case testLiteralSemanalInFunction] 14 | from typing_extensions import Literal 15 | def foo(a: Literal[1], b: Literal[" foo "]) -> Literal[True]: pass 16 | [builtins fixtures/bool.pyi] 17 | [out] 18 | MypyFile:1( 19 | ImportFrom:1(typing_extensions, [Literal]) 20 | FuncDef:2( 21 | foo 22 | Args( 23 | Var(a) 24 | Var(b)) 25 | def (a: Literal[1], b: Literal[' foo ']) -> Literal[True] 26 | Block:2( 27 | PassStmt:2()))) 28 | -------------------------------------------------------------------------------- /test-requirements.txt: -------------------------------------------------------------------------------- 1 | -r mypy-requirements.txt 2 | -r build-requirements.txt 3 | attrs>=18.0 4 | flake8>=3.8.1 5 | flake8-bugbear; python_version >= '3.5' 6 | flake8-pyi>=20.5; python_version >= '3.6' 7 | lxml>=4.4.0 8 | psutil>=4.0 9 | # pytest 6.2 does not support Python 3.5 10 | pytest>=6.1.0,<6.2.0 11 | pytest-xdist>=1.34.0,<2.0.0 12 | pytest-forked>=1.3.0,<2.0.0 13 | pytest-cov>=2.10.0,<3.0.0 14 | typing>=3.5.2; python_version < '3.5' 15 | py>=1.5.2 16 | virtualenv<20 17 | setuptools!=50 18 | importlib-metadata==0.20 19 | --------------------------------------------------------------------------------