mypy-dev 1.9.0.dev0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mypy/__init__.py +1 -0
- mypy/__main__.py +37 -0
- mypy/api.py +94 -0
- mypy/applytype.py +156 -0
- mypy/argmap.py +268 -0
- mypy/binder.py +538 -0
- mypy/bogus_type.py +27 -0
- mypy/build.py +3562 -0
- mypy/checker.py +8372 -0
- mypy/checkexpr.py +6615 -0
- mypy/checkmember.py +1356 -0
- mypy/checkpattern.py +801 -0
- mypy/checkstrformat.py +1109 -0
- mypy/config_parser.py +670 -0
- mypy/constant_fold.py +187 -0
- mypy/constraints.py +1624 -0
- mypy/copytype.py +133 -0
- mypy/defaults.py +46 -0
- mypy/dmypy/__init__.py +0 -0
- mypy/dmypy/__main__.py +6 -0
- mypy/dmypy/client.py +749 -0
- mypy/dmypy_os.py +42 -0
- mypy/dmypy_server.py +1107 -0
- mypy/dmypy_util.py +117 -0
- mypy/erasetype.py +278 -0
- mypy/errorcodes.py +285 -0
- mypy/errors.py +1280 -0
- mypy/evalexpr.py +205 -0
- mypy/expandtype.py +510 -0
- mypy/exprtotype.py +206 -0
- mypy/fastparse.py +2147 -0
- mypy/find_sources.py +243 -0
- mypy/fixup.py +426 -0
- mypy/freetree.py +23 -0
- mypy/fscache.py +309 -0
- mypy/fswatcher.py +106 -0
- mypy/gclogger.py +47 -0
- mypy/git.py +34 -0
- mypy/graph_utils.py +112 -0
- mypy/indirection.py +121 -0
- mypy/infer.py +75 -0
- mypy/inspections.py +627 -0
- mypy/ipc.py +310 -0
- mypy/join.py +866 -0
- mypy/literals.py +306 -0
- mypy/lookup.py +61 -0
- mypy/main.py +1574 -0
- mypy/maptype.py +106 -0
- mypy/meet.py +1140 -0
- mypy/memprofile.py +121 -0
- mypy/message_registry.py +326 -0
- mypy/messages.py +3171 -0
- mypy/metastore.py +225 -0
- mypy/mixedtraverser.py +112 -0
- mypy/modulefinder.py +875 -0
- mypy/moduleinspect.py +184 -0
- mypy/mro.py +62 -0
- mypy/nodes.py +4112 -0
- mypy/operators.py +126 -0
- mypy/options.py +556 -0
- mypy/parse.py +30 -0
- mypy/partially_defined.py +675 -0
- mypy/patterns.py +150 -0
- mypy/plugin.py +901 -0
- mypy/plugins/__init__.py +0 -0
- mypy/plugins/attrs.py +1152 -0
- mypy/plugins/common.py +440 -0
- mypy/plugins/ctypes.py +245 -0
- mypy/plugins/dataclasses.py +1101 -0
- mypy/plugins/default.py +518 -0
- mypy/plugins/enums.py +259 -0
- mypy/plugins/functools.py +104 -0
- mypy/plugins/proper_plugin.py +175 -0
- mypy/plugins/singledispatch.py +224 -0
- mypy/py.typed +1 -0
- mypy/pyinfo.py +78 -0
- mypy/reachability.py +362 -0
- mypy/refinfo.py +92 -0
- mypy/renaming.py +568 -0
- mypy/report.py +924 -0
- mypy/scope.py +125 -0
- mypy/semanal.py +7023 -0
- mypy/semanal_classprop.py +187 -0
- mypy/semanal_enum.py +253 -0
- mypy/semanal_infer.py +128 -0
- mypy/semanal_main.py +511 -0
- mypy/semanal_namedtuple.py +670 -0
- mypy/semanal_newtype.py +273 -0
- mypy/semanal_pass1.py +156 -0
- mypy/semanal_shared.py +490 -0
- mypy/semanal_typeargs.py +265 -0
- mypy/semanal_typeddict.py +575 -0
- mypy/server/__init__.py +0 -0
- mypy/server/astdiff.py +518 -0
- mypy/server/astmerge.py +562 -0
- mypy/server/aststrip.py +281 -0
- mypy/server/deps.py +1137 -0
- mypy/server/mergecheck.py +83 -0
- mypy/server/objgraph.py +101 -0
- mypy/server/subexpr.py +198 -0
- mypy/server/target.py +11 -0
- mypy/server/trigger.py +26 -0
- mypy/server/update.py +1339 -0
- mypy/sharedparse.py +112 -0
- mypy/solve.py +562 -0
- mypy/split_namespace.py +35 -0
- mypy/state.py +28 -0
- mypy/stats.py +489 -0
- mypy/strconv.py +641 -0
- mypy/stubdoc.py +491 -0
- mypy/stubgen.py +1873 -0
- mypy/stubgenc.py +993 -0
- mypy/stubinfo.py +173 -0
- mypy/stubtest.py +2079 -0
- mypy/stubutil.py +807 -0
- mypy/subtypes.py +1967 -0
- mypy/suggestions.py +1046 -0
- mypy/test/__init__.py +0 -0
- mypy/test/config.py +28 -0
- mypy/test/data.py +823 -0
- mypy/test/helpers.py +476 -0
- mypy/test/meta/__init__.py +0 -0
- mypy/test/meta/_pytest.py +72 -0
- mypy/test/meta/test_diff_helper.py +47 -0
- mypy/test/meta/test_parse_data.py +73 -0
- mypy/test/meta/test_update_data.py +135 -0
- mypy/test/test_find_sources.py +376 -0
- mypy/test/test_ref_info.py +45 -0
- mypy/test/testapi.py +45 -0
- mypy/test/testargs.py +77 -0
- mypy/test/testcheck.py +322 -0
- mypy/test/testcmdline.py +152 -0
- mypy/test/testconstraints.py +134 -0
- mypy/test/testdaemon.py +132 -0
- mypy/test/testdeps.py +77 -0
- mypy/test/testdiff.py +67 -0
- mypy/test/testerrorstream.py +46 -0
- mypy/test/testfinegrained.py +438 -0
- mypy/test/testfinegrainedcache.py +18 -0
- mypy/test/testformatter.py +85 -0
- mypy/test/testfscache.py +101 -0
- mypy/test/testgraph.py +83 -0
- mypy/test/testinfer.py +373 -0
- mypy/test/testipc.py +119 -0
- mypy/test/testmerge.py +238 -0
- mypy/test/testmodulefinder.py +278 -0
- mypy/test/testmypyc.py +14 -0
- mypy/test/testparse.py +107 -0
- mypy/test/testpep561.py +211 -0
- mypy/test/testpythoneval.py +117 -0
- mypy/test/testreports.py +55 -0
- mypy/test/testsemanal.py +209 -0
- mypy/test/testsolve.py +285 -0
- mypy/test/teststubgen.py +1412 -0
- mypy/test/teststubinfo.py +12 -0
- mypy/test/teststubtest.py +2492 -0
- mypy/test/testsubtypes.py +303 -0
- mypy/test/testtransform.py +64 -0
- mypy/test/testtypegen.py +83 -0
- mypy/test/testtypes.py +1551 -0
- mypy/test/testutil.py +111 -0
- mypy/test/typefixture.py +415 -0
- mypy/test/update_data.py +87 -0
- mypy/test/visitors.py +63 -0
- mypy/traverser.py +961 -0
- mypy/treetransform.py +800 -0
- mypy/tvar_scope.py +147 -0
- mypy/type_visitor.py +564 -0
- mypy/typeanal.py +2510 -0
- mypy/typeops.py +1082 -0
- mypy/types.py +3686 -0
- mypy/types_utils.py +166 -0
- mypy/typeshed/LICENSE +237 -0
- mypy/typeshed/stdlib/VERSIONS +308 -0
- mypy/typeshed/stdlib/__future__.pyi +36 -0
- mypy/typeshed/stdlib/__main__.pyi +3 -0
- mypy/typeshed/stdlib/_ast.pyi +587 -0
- mypy/typeshed/stdlib/_bisect.pyi +84 -0
- mypy/typeshed/stdlib/_bootlocale.pyi +1 -0
- mypy/typeshed/stdlib/_codecs.pyi +133 -0
- mypy/typeshed/stdlib/_collections_abc.pyi +94 -0
- mypy/typeshed/stdlib/_compat_pickle.pyi +8 -0
- mypy/typeshed/stdlib/_compression.pyi +25 -0
- mypy/typeshed/stdlib/_csv.pyi +90 -0
- mypy/typeshed/stdlib/_ctypes.pyi +205 -0
- mypy/typeshed/stdlib/_curses.pyi +557 -0
- mypy/typeshed/stdlib/_decimal.pyi +281 -0
- mypy/typeshed/stdlib/_dummy_thread.pyi +27 -0
- mypy/typeshed/stdlib/_dummy_threading.pyi +164 -0
- mypy/typeshed/stdlib/_heapq.pyi +11 -0
- mypy/typeshed/stdlib/_imp.pyi +28 -0
- mypy/typeshed/stdlib/_json.pyi +49 -0
- mypy/typeshed/stdlib/_locale.pyi +100 -0
- mypy/typeshed/stdlib/_markupbase.pyi +16 -0
- mypy/typeshed/stdlib/_msi.pyi +91 -0
- mypy/typeshed/stdlib/_operator.pyi +147 -0
- mypy/typeshed/stdlib/_osx_support.pyi +34 -0
- mypy/typeshed/stdlib/_posixsubprocess.pyi +32 -0
- mypy/typeshed/stdlib/_py_abc.pyi +14 -0
- mypy/typeshed/stdlib/_pydecimal.pyi +43 -0
- mypy/typeshed/stdlib/_random.pyi +12 -0
- mypy/typeshed/stdlib/_sitebuiltins.pyi +16 -0
- mypy/typeshed/stdlib/_socket.pyi +802 -0
- mypy/typeshed/stdlib/_stat.pyi +103 -0
- mypy/typeshed/stdlib/_thread.pyi +52 -0
- mypy/typeshed/stdlib/_threading_local.pyi +17 -0
- mypy/typeshed/stdlib/_tkinter.pyi +120 -0
- mypy/typeshed/stdlib/_tracemalloc.pyi +17 -0
- mypy/typeshed/stdlib/_typeshed/__init__.pyi +347 -0
- mypy/typeshed/stdlib/_typeshed/dbapi.pyi +37 -0
- mypy/typeshed/stdlib/_typeshed/wsgi.pyi +44 -0
- mypy/typeshed/stdlib/_typeshed/xml.pyi +9 -0
- mypy/typeshed/stdlib/_warnings.pyi +55 -0
- mypy/typeshed/stdlib/_weakref.pyi +41 -0
- mypy/typeshed/stdlib/_weakrefset.pyi +51 -0
- mypy/typeshed/stdlib/_winapi.pyi +251 -0
- mypy/typeshed/stdlib/abc.pyi +49 -0
- mypy/typeshed/stdlib/aifc.pyi +91 -0
- mypy/typeshed/stdlib/antigravity.pyi +3 -0
- mypy/typeshed/stdlib/argparse.pyi +571 -0
- mypy/typeshed/stdlib/array.pyi +92 -0
- mypy/typeshed/stdlib/ast.pyi +277 -0
- mypy/typeshed/stdlib/asynchat.pyi +21 -0
- mypy/typeshed/stdlib/asyncio/__init__.pyi +41 -0
- mypy/typeshed/stdlib/asyncio/base_events.pyi +440 -0
- mypy/typeshed/stdlib/asyncio/base_futures.pyi +19 -0
- mypy/typeshed/stdlib/asyncio/base_subprocess.pyi +63 -0
- mypy/typeshed/stdlib/asyncio/base_tasks.pyi +9 -0
- mypy/typeshed/stdlib/asyncio/constants.pyi +20 -0
- mypy/typeshed/stdlib/asyncio/coroutines.pyi +26 -0
- mypy/typeshed/stdlib/asyncio/events.pyi +574 -0
- mypy/typeshed/stdlib/asyncio/exceptions.pyi +43 -0
- mypy/typeshed/stdlib/asyncio/format_helpers.pyi +20 -0
- mypy/typeshed/stdlib/asyncio/futures.pyi +57 -0
- mypy/typeshed/stdlib/asyncio/locks.pyi +121 -0
- mypy/typeshed/stdlib/asyncio/log.pyi +3 -0
- mypy/typeshed/stdlib/asyncio/mixins.pyi +9 -0
- mypy/typeshed/stdlib/asyncio/proactor_events.pyi +64 -0
- mypy/typeshed/stdlib/asyncio/protocols.pyi +34 -0
- mypy/typeshed/stdlib/asyncio/queues.pyi +47 -0
- mypy/typeshed/stdlib/asyncio/runners.pyi +32 -0
- mypy/typeshed/stdlib/asyncio/selector_events.pyi +8 -0
- mypy/typeshed/stdlib/asyncio/sslproto.pyi +163 -0
- mypy/typeshed/stdlib/asyncio/staggered.pyi +10 -0
- mypy/typeshed/stdlib/asyncio/streams.pyi +148 -0
- mypy/typeshed/stdlib/asyncio/subprocess.pyi +229 -0
- mypy/typeshed/stdlib/asyncio/taskgroups.pyi +25 -0
- mypy/typeshed/stdlib/asyncio/tasks.pyi +477 -0
- mypy/typeshed/stdlib/asyncio/threads.pyi +9 -0
- mypy/typeshed/stdlib/asyncio/timeouts.pyi +19 -0
- mypy/typeshed/stdlib/asyncio/transports.pyi +47 -0
- mypy/typeshed/stdlib/asyncio/trsock.pyi +98 -0
- mypy/typeshed/stdlib/asyncio/unix_events.pyi +173 -0
- mypy/typeshed/stdlib/asyncio/windows_events.pyi +83 -0
- mypy/typeshed/stdlib/asyncio/windows_utils.pyi +49 -0
- mypy/typeshed/stdlib/asyncore.pyi +90 -0
- mypy/typeshed/stdlib/atexit.pyi +12 -0
- mypy/typeshed/stdlib/audioop.pyi +42 -0
- mypy/typeshed/stdlib/base64.pyi +59 -0
- mypy/typeshed/stdlib/bdb.pyi +102 -0
- mypy/typeshed/stdlib/binascii.pyi +36 -0
- mypy/typeshed/stdlib/binhex.pyi +45 -0
- mypy/typeshed/stdlib/bisect.pyi +4 -0
- mypy/typeshed/stdlib/builtins.pyi +1937 -0
- mypy/typeshed/stdlib/bz2.pyi +146 -0
- mypy/typeshed/stdlib/cProfile.pyi +35 -0
- mypy/typeshed/stdlib/calendar.pyi +206 -0
- mypy/typeshed/stdlib/cgi.pyi +118 -0
- mypy/typeshed/stdlib/cgitb.pyi +32 -0
- mypy/typeshed/stdlib/chunk.pyi +20 -0
- mypy/typeshed/stdlib/cmath.pyi +36 -0
- mypy/typeshed/stdlib/cmd.pyi +45 -0
- mypy/typeshed/stdlib/code.pyi +33 -0
- mypy/typeshed/stdlib/codecs.pyi +285 -0
- mypy/typeshed/stdlib/codeop.pyi +13 -0
- mypy/typeshed/stdlib/collections/__init__.pyi +477 -0
- mypy/typeshed/stdlib/collections/abc.pyi +2 -0
- mypy/typeshed/stdlib/colorsys.pyi +13 -0
- mypy/typeshed/stdlib/compileall.pyi +111 -0
- mypy/typeshed/stdlib/concurrent/__init__.pyi +0 -0
- mypy/typeshed/stdlib/concurrent/futures/__init__.pyi +32 -0
- mypy/typeshed/stdlib/concurrent/futures/_base.pyi +120 -0
- mypy/typeshed/stdlib/concurrent/futures/process.pyi +233 -0
- mypy/typeshed/stdlib/concurrent/futures/thread.pyi +80 -0
- mypy/typeshed/stdlib/configparser.pyi +313 -0
- mypy/typeshed/stdlib/contextlib.pyi +207 -0
- mypy/typeshed/stdlib/contextvars.pyi +63 -0
- mypy/typeshed/stdlib/copy.pyi +16 -0
- mypy/typeshed/stdlib/copyreg.pyi +21 -0
- mypy/typeshed/stdlib/crypt.pyi +12 -0
- mypy/typeshed/stdlib/csv.pyi +147 -0
- mypy/typeshed/stdlib/ctypes/__init__.pyi +187 -0
- mypy/typeshed/stdlib/ctypes/_endian.pyi +19 -0
- mypy/typeshed/stdlib/ctypes/util.pyi +6 -0
- mypy/typeshed/stdlib/ctypes/wintypes.pyi +298 -0
- mypy/typeshed/stdlib/curses/__init__.pyi +21 -0
- mypy/typeshed/stdlib/curses/ascii.pyi +63 -0
- mypy/typeshed/stdlib/curses/has_key.pyi +4 -0
- mypy/typeshed/stdlib/curses/panel.pyi +25 -0
- mypy/typeshed/stdlib/curses/textpad.pyi +13 -0
- mypy/typeshed/stdlib/dataclasses.pyi +313 -0
- mypy/typeshed/stdlib/datetime.pyi +295 -0
- mypy/typeshed/stdlib/dbm/__init__.pyi +95 -0
- mypy/typeshed/stdlib/dbm/dumb.pyi +31 -0
- mypy/typeshed/stdlib/dbm/gnu.pyi +40 -0
- mypy/typeshed/stdlib/dbm/ndbm.pyi +36 -0
- mypy/typeshed/stdlib/decimal.pyi +2 -0
- mypy/typeshed/stdlib/difflib.pyi +140 -0
- mypy/typeshed/stdlib/dis.pyi +144 -0
- mypy/typeshed/stdlib/distutils/__init__.pyi +5 -0
- mypy/typeshed/stdlib/distutils/archive_util.pyi +20 -0
- mypy/typeshed/stdlib/distutils/bcppcompiler.pyi +3 -0
- mypy/typeshed/stdlib/distutils/ccompiler.pyi +152 -0
- mypy/typeshed/stdlib/distutils/cmd.pyi +66 -0
- mypy/typeshed/stdlib/distutils/command/__init__.pyi +0 -0
- mypy/typeshed/stdlib/distutils/command/bdist.pyi +25 -0
- mypy/typeshed/stdlib/distutils/command/bdist_dumb.pyi +21 -0
- mypy/typeshed/stdlib/distutils/command/bdist_msi.pyi +45 -0
- mypy/typeshed/stdlib/distutils/command/bdist_packager.pyi +0 -0
- mypy/typeshed/stdlib/distutils/command/bdist_rpm.pyi +52 -0
- mypy/typeshed/stdlib/distutils/command/bdist_wininst.pyi +16 -0
- mypy/typeshed/stdlib/distutils/command/build.pyi +31 -0
- mypy/typeshed/stdlib/distutils/command/build_clib.pyi +27 -0
- mypy/typeshed/stdlib/distutils/command/build_ext.pyi +50 -0
- mypy/typeshed/stdlib/distutils/command/build_py.pyi +44 -0
- mypy/typeshed/stdlib/distutils/command/build_scripts.pyi +24 -0
- mypy/typeshed/stdlib/distutils/command/check.pyi +39 -0
- mypy/typeshed/stdlib/distutils/command/clean.pyi +17 -0
- mypy/typeshed/stdlib/distutils/command/config.pyi +83 -0
- mypy/typeshed/stdlib/distutils/command/install.pyi +63 -0
- mypy/typeshed/stdlib/distutils/command/install_data.pyi +19 -0
- mypy/typeshed/stdlib/distutils/command/install_egg_info.pyi +18 -0
- mypy/typeshed/stdlib/distutils/command/install_headers.pyi +16 -0
- mypy/typeshed/stdlib/distutils/command/install_lib.pyi +25 -0
- mypy/typeshed/stdlib/distutils/command/install_scripts.pyi +18 -0
- mypy/typeshed/stdlib/distutils/command/register.pyi +18 -0
- mypy/typeshed/stdlib/distutils/command/sdist.pyi +42 -0
- mypy/typeshed/stdlib/distutils/command/upload.pyi +17 -0
- mypy/typeshed/stdlib/distutils/config.pyi +17 -0
- mypy/typeshed/stdlib/distutils/core.pyi +57 -0
- mypy/typeshed/stdlib/distutils/cygwinccompiler.pyi +20 -0
- mypy/typeshed/stdlib/distutils/debug.pyi +1 -0
- mypy/typeshed/stdlib/distutils/dep_util.pyi +3 -0
- mypy/typeshed/stdlib/distutils/dir_util.pyi +13 -0
- mypy/typeshed/stdlib/distutils/dist.pyi +146 -0
- mypy/typeshed/stdlib/distutils/errors.pyi +19 -0
- mypy/typeshed/stdlib/distutils/extension.pyi +36 -0
- mypy/typeshed/stdlib/distutils/fancy_getopt.pyi +34 -0
- mypy/typeshed/stdlib/distutils/file_util.pyi +14 -0
- mypy/typeshed/stdlib/distutils/filelist.pyi +50 -0
- mypy/typeshed/stdlib/distutils/log.pyi +25 -0
- mypy/typeshed/stdlib/distutils/msvccompiler.pyi +3 -0
- mypy/typeshed/stdlib/distutils/spawn.pyi +2 -0
- mypy/typeshed/stdlib/distutils/sysconfig.pyi +22 -0
- mypy/typeshed/stdlib/distutils/text_file.pyi +21 -0
- mypy/typeshed/stdlib/distutils/unixccompiler.pyi +3 -0
- mypy/typeshed/stdlib/distutils/util.pyi +46 -0
- mypy/typeshed/stdlib/distutils/version.pyi +36 -0
- mypy/typeshed/stdlib/doctest.pyi +248 -0
- mypy/typeshed/stdlib/dummy_threading.pyi +2 -0
- mypy/typeshed/stdlib/email/__init__.pyi +29 -0
- mypy/typeshed/stdlib/email/_header_value_parser.pyi +392 -0
- mypy/typeshed/stdlib/email/_policybase.pyi +51 -0
- mypy/typeshed/stdlib/email/base64mime.pyi +13 -0
- mypy/typeshed/stdlib/email/charset.pyi +34 -0
- mypy/typeshed/stdlib/email/contentmanager.pyi +11 -0
- mypy/typeshed/stdlib/email/encoders.pyi +8 -0
- mypy/typeshed/stdlib/email/errors.pyi +39 -0
- mypy/typeshed/stdlib/email/feedparser.pyi +23 -0
- mypy/typeshed/stdlib/email/generator.pyi +40 -0
- mypy/typeshed/stdlib/email/header.pyi +31 -0
- mypy/typeshed/stdlib/email/headerregistry.pyi +178 -0
- mypy/typeshed/stdlib/email/iterators.pyi +12 -0
- mypy/typeshed/stdlib/email/message.pyi +161 -0
- mypy/typeshed/stdlib/email/mime/__init__.pyi +0 -0
- mypy/typeshed/stdlib/email/mime/application.pyi +17 -0
- mypy/typeshed/stdlib/email/mime/audio.pyi +17 -0
- mypy/typeshed/stdlib/email/mime/base.pyi +8 -0
- mypy/typeshed/stdlib/email/mime/image.pyi +17 -0
- mypy/typeshed/stdlib/email/mime/message.pyi +8 -0
- mypy/typeshed/stdlib/email/mime/multipart.pyi +18 -0
- mypy/typeshed/stdlib/email/mime/nonmultipart.pyi +5 -0
- mypy/typeshed/stdlib/email/mime/text.pyi +9 -0
- mypy/typeshed/stdlib/email/parser.pyi +26 -0
- mypy/typeshed/stdlib/email/policy.pyi +38 -0
- mypy/typeshed/stdlib/email/quoprimime.pyi +28 -0
- mypy/typeshed/stdlib/email/utils.pyi +66 -0
- mypy/typeshed/stdlib/encodings/__init__.pyi +10 -0
- mypy/typeshed/stdlib/encodings/utf_8.pyi +21 -0
- mypy/typeshed/stdlib/encodings/utf_8_sig.pyi +22 -0
- mypy/typeshed/stdlib/ensurepip/__init__.pyi +12 -0
- mypy/typeshed/stdlib/enum.pyi +317 -0
- mypy/typeshed/stdlib/errno.pyi +222 -0
- mypy/typeshed/stdlib/faulthandler.pyi +13 -0
- mypy/typeshed/stdlib/fcntl.pyi +127 -0
- mypy/typeshed/stdlib/filecmp.pyi +57 -0
- mypy/typeshed/stdlib/fileinput.pyi +213 -0
- mypy/typeshed/stdlib/fnmatch.pyi +9 -0
- mypy/typeshed/stdlib/formatter.pyi +88 -0
- mypy/typeshed/stdlib/fractions.pyi +150 -0
- mypy/typeshed/stdlib/ftplib.pyi +178 -0
- mypy/typeshed/stdlib/functools.pyi +200 -0
- mypy/typeshed/stdlib/gc.pyi +37 -0
- mypy/typeshed/stdlib/genericpath.pyi +52 -0
- mypy/typeshed/stdlib/getopt.pyi +11 -0
- mypy/typeshed/stdlib/getpass.pyi +8 -0
- mypy/typeshed/stdlib/gettext.pyi +169 -0
- mypy/typeshed/stdlib/glob.pyi +42 -0
- mypy/typeshed/stdlib/graphlib.pyi +28 -0
- mypy/typeshed/stdlib/grp.pyi +21 -0
- mypy/typeshed/stdlib/gzip.pyi +160 -0
- mypy/typeshed/stdlib/hashlib.pyi +165 -0
- mypy/typeshed/stdlib/heapq.pyi +17 -0
- mypy/typeshed/stdlib/hmac.pyi +38 -0
- mypy/typeshed/stdlib/html/__init__.pyi +6 -0
- mypy/typeshed/stdlib/html/entities.pyi +6 -0
- mypy/typeshed/stdlib/html/parser.pyi +34 -0
- mypy/typeshed/stdlib/http/__init__.pyi +105 -0
- mypy/typeshed/stdlib/http/client.pyi +259 -0
- mypy/typeshed/stdlib/http/cookiejar.pyi +159 -0
- mypy/typeshed/stdlib/http/cookies.pyi +60 -0
- mypy/typeshed/stdlib/http/server.pyi +83 -0
- mypy/typeshed/stdlib/imaplib.pyi +168 -0
- mypy/typeshed/stdlib/imghdr.pyi +17 -0
- mypy/typeshed/stdlib/imp.pyi +62 -0
- mypy/typeshed/stdlib/importlib/__init__.pyi +24 -0
- mypy/typeshed/stdlib/importlib/_abc.pyi +15 -0
- mypy/typeshed/stdlib/importlib/abc.pyi +172 -0
- mypy/typeshed/stdlib/importlib/machinery.pyi +179 -0
- mypy/typeshed/stdlib/importlib/metadata/__init__.pyi +276 -0
- mypy/typeshed/stdlib/importlib/metadata/_meta.pyi +40 -0
- mypy/typeshed/stdlib/importlib/readers.pyi +68 -0
- mypy/typeshed/stdlib/importlib/resources/__init__.pyi +46 -0
- mypy/typeshed/stdlib/importlib/resources/abc.pyi +12 -0
- mypy/typeshed/stdlib/importlib/resources/readers.pyi +14 -0
- mypy/typeshed/stdlib/importlib/resources/simple.pyi +49 -0
- mypy/typeshed/stdlib/importlib/simple.pyi +11 -0
- mypy/typeshed/stdlib/importlib/util.pyi +43 -0
- mypy/typeshed/stdlib/inspect.pyi +631 -0
- mypy/typeshed/stdlib/io.pyi +204 -0
- mypy/typeshed/stdlib/ipaddress.pyi +208 -0
- mypy/typeshed/stdlib/itertools.pyi +293 -0
- mypy/typeshed/stdlib/json/__init__.pyi +61 -0
- mypy/typeshed/stdlib/json/decoder.pyi +32 -0
- mypy/typeshed/stdlib/json/encoder.pyi +38 -0
- mypy/typeshed/stdlib/json/tool.pyi +1 -0
- mypy/typeshed/stdlib/keyword.pyi +21 -0
- mypy/typeshed/stdlib/lib2to3/__init__.pyi +0 -0
- mypy/typeshed/stdlib/lib2to3/btm_matcher.pyi +28 -0
- mypy/typeshed/stdlib/lib2to3/fixer_base.pyi +42 -0
- mypy/typeshed/stdlib/lib2to3/fixes/__init__.pyi +0 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi +10 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi +16 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_except.pyi +14 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi +13 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi +9 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_future.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi +15 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_import.pyi +16 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi +21 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi +6 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_input.pyi +11 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi +9 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi +9 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi +7 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_long.pyi +7 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_map.pyi +9 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi +17 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi +10 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_next.pyi +19 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi +12 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_print.pyi +12 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi +9 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi +17 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi +7 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi +9 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi +17 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_types.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi +12 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi +15 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi +12 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi +20 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi +8 -0
- mypy/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi +9 -0
- mypy/typeshed/stdlib/lib2to3/main.pyi +42 -0
- mypy/typeshed/stdlib/lib2to3/pgen2/__init__.pyi +9 -0
- mypy/typeshed/stdlib/lib2to3/pgen2/driver.pyi +27 -0
- mypy/typeshed/stdlib/lib2to3/pgen2/grammar.pyi +24 -0
- mypy/typeshed/stdlib/lib2to3/pgen2/literals.pyi +7 -0
- mypy/typeshed/stdlib/lib2to3/pgen2/parse.pyi +30 -0
- mypy/typeshed/stdlib/lib2to3/pgen2/pgen.pyi +50 -0
- mypy/typeshed/stdlib/lib2to3/pgen2/token.pyi +67 -0
- mypy/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi +96 -0
- mypy/typeshed/stdlib/lib2to3/pygram.pyi +114 -0
- mypy/typeshed/stdlib/lib2to3/pytree.pyi +117 -0
- mypy/typeshed/stdlib/lib2to3/refactor.pyi +82 -0
- mypy/typeshed/stdlib/linecache.pyi +23 -0
- mypy/typeshed/stdlib/locale.pyi +152 -0
- mypy/typeshed/stdlib/logging/__init__.pyi +655 -0
- mypy/typeshed/stdlib/logging/config.pyi +134 -0
- mypy/typeshed/stdlib/logging/handlers.pyi +275 -0
- mypy/typeshed/stdlib/lzma.pyi +197 -0
- mypy/typeshed/stdlib/mailbox.pyi +256 -0
- mypy/typeshed/stdlib/mailcap.pyi +11 -0
- mypy/typeshed/stdlib/marshal.pyi +33 -0
- mypy/typeshed/stdlib/math.pyi +125 -0
- mypy/typeshed/stdlib/mimetypes.pyi +46 -0
- mypy/typeshed/stdlib/mmap.pyi +113 -0
- mypy/typeshed/stdlib/modulefinder.pyi +66 -0
- mypy/typeshed/stdlib/msilib/__init__.pyi +176 -0
- mypy/typeshed/stdlib/msilib/schema.pyi +94 -0
- mypy/typeshed/stdlib/msilib/sequence.pyi +13 -0
- mypy/typeshed/stdlib/msilib/text.pyi +7 -0
- mypy/typeshed/stdlib/msvcrt.pyi +32 -0
- mypy/typeshed/stdlib/multiprocessing/__init__.pyi +90 -0
- mypy/typeshed/stdlib/multiprocessing/connection.pyi +75 -0
- mypy/typeshed/stdlib/multiprocessing/context.pyi +187 -0
- mypy/typeshed/stdlib/multiprocessing/dummy/__init__.pyi +77 -0
- mypy/typeshed/stdlib/multiprocessing/dummy/connection.pyi +39 -0
- mypy/typeshed/stdlib/multiprocessing/forkserver.pyi +31 -0
- mypy/typeshed/stdlib/multiprocessing/heap.pyi +36 -0
- mypy/typeshed/stdlib/multiprocessing/managers.pyi +212 -0
- mypy/typeshed/stdlib/multiprocessing/pool.pyi +103 -0
- mypy/typeshed/stdlib/multiprocessing/popen_fork.pyi +23 -0
- mypy/typeshed/stdlib/multiprocessing/popen_forkserver.pyi +16 -0
- mypy/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi +20 -0
- mypy/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi +30 -0
- mypy/typeshed/stdlib/multiprocessing/process.pyi +39 -0
- mypy/typeshed/stdlib/multiprocessing/queues.pyi +41 -0
- mypy/typeshed/stdlib/multiprocessing/reduction.pyi +89 -0
- mypy/typeshed/stdlib/multiprocessing/resource_sharer.pyi +20 -0
- mypy/typeshed/stdlib/multiprocessing/resource_tracker.pyi +18 -0
- mypy/typeshed/stdlib/multiprocessing/shared_memory.pyi +40 -0
- mypy/typeshed/stdlib/multiprocessing/sharedctypes.pyi +101 -0
- mypy/typeshed/stdlib/multiprocessing/spawn.pyi +32 -0
- mypy/typeshed/stdlib/multiprocessing/synchronize.pyi +54 -0
- mypy/typeshed/stdlib/multiprocessing/util.pyi +79 -0
- mypy/typeshed/stdlib/netrc.pyi +23 -0
- mypy/typeshed/stdlib/nis.pyi +9 -0
- mypy/typeshed/stdlib/nntplib.pyi +125 -0
- mypy/typeshed/stdlib/nt.pyi +111 -0
- mypy/typeshed/stdlib/ntpath.pyi +119 -0
- mypy/typeshed/stdlib/nturl2path.pyi +2 -0
- mypy/typeshed/stdlib/numbers.pyi +154 -0
- mypy/typeshed/stdlib/opcode.pyi +59 -0
- mypy/typeshed/stdlib/operator.pyi +110 -0
- mypy/typeshed/stdlib/optparse.pyi +252 -0
- mypy/typeshed/stdlib/os/__init__.pyi +1139 -0
- mypy/typeshed/stdlib/os/path.pyi +8 -0
- mypy/typeshed/stdlib/ossaudiodev.pyi +131 -0
- mypy/typeshed/stdlib/parser.pyi +24 -0
- mypy/typeshed/stdlib/pathlib.pyi +232 -0
- mypy/typeshed/stdlib/pdb.pyi +181 -0
- mypy/typeshed/stdlib/pickle.pyi +270 -0
- mypy/typeshed/stdlib/pickletools.pyi +167 -0
- mypy/typeshed/stdlib/pipes.pyi +16 -0
- mypy/typeshed/stdlib/pkgutil.pyi +53 -0
- mypy/typeshed/stdlib/platform.pyi +42 -0
- mypy/typeshed/stdlib/plistlib.pyi +113 -0
- mypy/typeshed/stdlib/poplib.pyi +71 -0
- mypy/typeshed/stdlib/posix.pyi +359 -0
- mypy/typeshed/stdlib/posixpath.pyi +161 -0
- mypy/typeshed/stdlib/pprint.pyi +112 -0
- mypy/typeshed/stdlib/profile.pyi +31 -0
- mypy/typeshed/stdlib/pstats.pyi +78 -0
- mypy/typeshed/stdlib/pty.pyi +19 -0
- mypy/typeshed/stdlib/pwd.pyi +27 -0
- mypy/typeshed/stdlib/py_compile.pyi +34 -0
- mypy/typeshed/stdlib/pyclbr.pyi +74 -0
- mypy/typeshed/stdlib/pydoc.pyi +261 -0
- mypy/typeshed/stdlib/pydoc_data/__init__.pyi +0 -0
- mypy/typeshed/stdlib/pydoc_data/topics.pyi +1 -0
- mypy/typeshed/stdlib/pyexpat/__init__.pyi +80 -0
- mypy/typeshed/stdlib/pyexpat/errors.pyi +49 -0
- mypy/typeshed/stdlib/pyexpat/model.pyi +11 -0
- mypy/typeshed/stdlib/queue.pyi +58 -0
- mypy/typeshed/stdlib/quopri.pyi +11 -0
- mypy/typeshed/stdlib/random.pyi +138 -0
- mypy/typeshed/stdlib/re.pyi +290 -0
- mypy/typeshed/stdlib/readline.pyi +36 -0
- mypy/typeshed/stdlib/reprlib.pyi +65 -0
- mypy/typeshed/stdlib/resource.pyi +92 -0
- mypy/typeshed/stdlib/rlcompleter.pyi +9 -0
- mypy/typeshed/stdlib/runpy.pyi +24 -0
- mypy/typeshed/stdlib/sched.pyi +42 -0
- mypy/typeshed/stdlib/secrets.pyi +15 -0
- mypy/typeshed/stdlib/select.pyi +151 -0
- mypy/typeshed/stdlib/selectors.pyi +67 -0
- mypy/typeshed/stdlib/shelve.pyi +46 -0
- mypy/typeshed/stdlib/shlex.pyi +43 -0
- mypy/typeshed/stdlib/shutil.pyi +189 -0
- mypy/typeshed/stdlib/signal.pyi +189 -0
- mypy/typeshed/stdlib/site.pyi +27 -0
- mypy/typeshed/stdlib/smtpd.pyi +91 -0
- mypy/typeshed/stdlib/smtplib.pyi +204 -0
- mypy/typeshed/stdlib/sndhdr.pyi +14 -0
- mypy/typeshed/stdlib/socket.pyi +825 -0
- mypy/typeshed/stdlib/socketserver.pyi +168 -0
- mypy/typeshed/stdlib/spwd.pyi +40 -0
- mypy/typeshed/stdlib/sqlite3/__init__.pyi +1 -0
- mypy/typeshed/stdlib/sqlite3/dbapi2.pyi +469 -0
- mypy/typeshed/stdlib/sre_compile.pyi +11 -0
- mypy/typeshed/stdlib/sre_constants.pyi +130 -0
- mypy/typeshed/stdlib/sre_parse.pyi +104 -0
- mypy/typeshed/stdlib/ssl.pyi +529 -0
- mypy/typeshed/stdlib/stat.pyi +1 -0
- mypy/typeshed/stdlib/statistics.pyi +132 -0
- mypy/typeshed/stdlib/string.pyi +83 -0
- mypy/typeshed/stdlib/stringprep.pyi +27 -0
- mypy/typeshed/stdlib/struct.pyi +26 -0
- mypy/typeshed/stdlib/subprocess.pyi +2614 -0
- mypy/typeshed/stdlib/sunau.pyi +86 -0
- mypy/typeshed/stdlib/symbol.pyi +93 -0
- mypy/typeshed/stdlib/symtable.pyi +58 -0
- mypy/typeshed/stdlib/sys/__init__.pyi +373 -0
- mypy/typeshed/stdlib/sys/_monitoring.pyi +52 -0
- mypy/typeshed/stdlib/sysconfig.pyi +43 -0
- mypy/typeshed/stdlib/syslog.pyi +46 -0
- mypy/typeshed/stdlib/tabnanny.pyi +16 -0
- mypy/typeshed/stdlib/tarfile.pyi +438 -0
- mypy/typeshed/stdlib/telnetlib.pyi +122 -0
- mypy/typeshed/stdlib/tempfile.pyi +477 -0
- mypy/typeshed/stdlib/termios.pyi +267 -0
- mypy/typeshed/stdlib/textwrap.pyi +103 -0
- mypy/typeshed/stdlib/this.pyi +2 -0
- mypy/typeshed/stdlib/threading.pyi +187 -0
- mypy/typeshed/stdlib/time.pyi +107 -0
- mypy/typeshed/stdlib/timeit.pyi +32 -0
- mypy/typeshed/stdlib/tkinter/__init__.pyi +3641 -0
- mypy/typeshed/stdlib/tkinter/colorchooser.pyi +20 -0
- mypy/typeshed/stdlib/tkinter/commondialog.pyi +14 -0
- mypy/typeshed/stdlib/tkinter/constants.pyi +80 -0
- mypy/typeshed/stdlib/tkinter/dialog.pyi +16 -0
- mypy/typeshed/stdlib/tkinter/dnd.pyi +20 -0
- mypy/typeshed/stdlib/tkinter/filedialog.pyi +151 -0
- mypy/typeshed/stdlib/tkinter/font.pyi +116 -0
- mypy/typeshed/stdlib/tkinter/messagebox.pyi +44 -0
- mypy/typeshed/stdlib/tkinter/scrolledtext.pyi +10 -0
- mypy/typeshed/stdlib/tkinter/simpledialog.pyi +54 -0
- mypy/typeshed/stdlib/tkinter/tix.pyi +299 -0
- mypy/typeshed/stdlib/tkinter/ttk.pyi +1191 -0
- mypy/typeshed/stdlib/token.pyi +159 -0
- mypy/typeshed/stdlib/tokenize.pyi +177 -0
- mypy/typeshed/stdlib/tomllib.pyi +10 -0
- mypy/typeshed/stdlib/trace.pyi +79 -0
- mypy/typeshed/stdlib/traceback.pyi +260 -0
- mypy/typeshed/stdlib/tracemalloc.pyi +124 -0
- mypy/typeshed/stdlib/tty.pyi +30 -0
- mypy/typeshed/stdlib/turtle.pyi +713 -0
- mypy/typeshed/stdlib/types.pyi +605 -0
- mypy/typeshed/stdlib/typing.pyi +968 -0
- mypy/typeshed/stdlib/typing_extensions.pyi +503 -0
- mypy/typeshed/stdlib/unicodedata.pyi +71 -0
- mypy/typeshed/stdlib/unittest/__init__.pyi +67 -0
- mypy/typeshed/stdlib/unittest/_log.pyi +27 -0
- mypy/typeshed/stdlib/unittest/async_case.pyi +21 -0
- mypy/typeshed/stdlib/unittest/case.pyi +342 -0
- mypy/typeshed/stdlib/unittest/loader.pyi +51 -0
- mypy/typeshed/stdlib/unittest/main.pyi +69 -0
- mypy/typeshed/stdlib/unittest/mock.pyi +430 -0
- mypy/typeshed/stdlib/unittest/result.pyi +46 -0
- mypy/typeshed/stdlib/unittest/runner.pyi +72 -0
- mypy/typeshed/stdlib/unittest/signals.pyi +15 -0
- mypy/typeshed/stdlib/unittest/suite.pyi +22 -0
- mypy/typeshed/stdlib/unittest/util.pyi +23 -0
- mypy/typeshed/stdlib/urllib/__init__.pyi +0 -0
- mypy/typeshed/stdlib/urllib/error.pyi +23 -0
- mypy/typeshed/stdlib/urllib/parse.pyi +210 -0
- mypy/typeshed/stdlib/urllib/request.pyi +399 -0
- mypy/typeshed/stdlib/urllib/response.pyi +43 -0
- mypy/typeshed/stdlib/urllib/robotparser.pyi +20 -0
- mypy/typeshed/stdlib/uu.pyi +13 -0
- mypy/typeshed/stdlib/uuid.pyi +100 -0
- mypy/typeshed/stdlib/venv/__init__.pyi +79 -0
- mypy/typeshed/stdlib/warnings.pyi +112 -0
- mypy/typeshed/stdlib/wave.pyi +85 -0
- mypy/typeshed/stdlib/weakref.pyi +150 -0
- mypy/typeshed/stdlib/webbrowser.pyi +74 -0
- mypy/typeshed/stdlib/winreg.pyi +103 -0
- mypy/typeshed/stdlib/winsound.pyi +28 -0
- mypy/typeshed/stdlib/wsgiref/__init__.pyi +0 -0
- mypy/typeshed/stdlib/wsgiref/handlers.pyi +91 -0
- mypy/typeshed/stdlib/wsgiref/headers.pyi +26 -0
- mypy/typeshed/stdlib/wsgiref/simple_server.pyi +37 -0
- mypy/typeshed/stdlib/wsgiref/types.pyi +32 -0
- mypy/typeshed/stdlib/wsgiref/util.pyi +24 -0
- mypy/typeshed/stdlib/wsgiref/validate.pyi +50 -0
- mypy/typeshed/stdlib/xdrlib.pyi +57 -0
- mypy/typeshed/stdlib/xml/__init__.pyi +1 -0
- mypy/typeshed/stdlib/xml/dom/NodeFilter.pyi +19 -0
- mypy/typeshed/stdlib/xml/dom/__init__.pyi +69 -0
- mypy/typeshed/stdlib/xml/dom/domreg.pyi +8 -0
- mypy/typeshed/stdlib/xml/dom/expatbuilder.pyi +100 -0
- mypy/typeshed/stdlib/xml/dom/minicompat.pyi +22 -0
- mypy/typeshed/stdlib/xml/dom/minidom.pyi +404 -0
- mypy/typeshed/stdlib/xml/dom/pulldom.pyi +94 -0
- mypy/typeshed/stdlib/xml/dom/xmlbuilder.pyi +108 -0
- mypy/typeshed/stdlib/xml/etree/ElementInclude.pyi +28 -0
- mypy/typeshed/stdlib/xml/etree/ElementPath.pyi +34 -0
- mypy/typeshed/stdlib/xml/etree/ElementTree.pyi +321 -0
- mypy/typeshed/stdlib/xml/etree/__init__.pyi +0 -0
- mypy/typeshed/stdlib/xml/etree/cElementTree.pyi +1 -0
- mypy/typeshed/stdlib/xml/parsers/__init__.pyi +1 -0
- mypy/typeshed/stdlib/xml/parsers/expat/__init__.pyi +1 -0
- mypy/typeshed/stdlib/xml/parsers/expat/errors.pyi +1 -0
- mypy/typeshed/stdlib/xml/parsers/expat/model.pyi +1 -0
- mypy/typeshed/stdlib/xml/sax/__init__.pyi +25 -0
- mypy/typeshed/stdlib/xml/sax/_exceptions.pyi +19 -0
- mypy/typeshed/stdlib/xml/sax/handler.pyi +55 -0
- mypy/typeshed/stdlib/xml/sax/saxutils.pyi +60 -0
- mypy/typeshed/stdlib/xml/sax/xmlreader.pyi +87 -0
- mypy/typeshed/stdlib/xmlrpc/__init__.pyi +0 -0
- mypy/typeshed/stdlib/xmlrpc/client.pyi +296 -0
- mypy/typeshed/stdlib/xmlrpc/server.pyi +143 -0
- mypy/typeshed/stdlib/xxlimited.pyi +22 -0
- mypy/typeshed/stdlib/zipapp.pyi +20 -0
- mypy/typeshed/stdlib/zipfile/__init__.pyi +306 -0
- mypy/typeshed/stdlib/zipfile/_path.pyi +95 -0
- mypy/typeshed/stdlib/zipimport.pyi +32 -0
- mypy/typeshed/stdlib/zlib.pyi +56 -0
- mypy/typeshed/stdlib/zoneinfo/__init__.pyi +38 -0
- mypy/typeshed/stubs/mypy-extensions/mypy_extensions.pyi +218 -0
- mypy/typestate.py +323 -0
- mypy/typetraverser.py +142 -0
- mypy/typevars.py +93 -0
- mypy/typevartuples.py +32 -0
- mypy/util.py +869 -0
- mypy/version.py +1 -0
- mypy/visitor.py +621 -0
- mypy/xml/mypy-html.css +104 -0
- mypy/xml/mypy-html.xslt +81 -0
- mypy/xml/mypy-txt.xslt +100 -0
- mypy/xml/mypy.xsd +50 -0
- mypy_dev-1.9.0.dev0.dist-info/LICENSE +229 -0
- mypy_dev-1.9.0.dev0.dist-info/METADATA +39 -0
- mypy_dev-1.9.0.dev0.dist-info/RECORD +1018 -0
- mypy_dev-1.9.0.dev0.dist-info/WHEEL +5 -0
- mypy_dev-1.9.0.dev0.dist-info/entry_points.txt +6 -0
- mypy_dev-1.9.0.dev0.dist-info/top_level.txt +2 -0
- mypyc/README.md +133 -0
- mypyc/__init__.py +0 -0
- mypyc/__main__.py +57 -0
- mypyc/analysis/__init__.py +0 -0
- mypyc/analysis/attrdefined.py +436 -0
- mypyc/analysis/blockfreq.py +32 -0
- mypyc/analysis/dataflow.py +624 -0
- mypyc/analysis/ircheck.py +429 -0
- mypyc/analysis/selfleaks.py +207 -0
- mypyc/build.py +616 -0
- mypyc/codegen/__init__.py +0 -0
- mypyc/codegen/cstring.py +54 -0
- mypyc/codegen/emit.py +1193 -0
- mypyc/codegen/emitclass.py +1060 -0
- mypyc/codegen/emitfunc.py +846 -0
- mypyc/codegen/emitmodule.py +1131 -0
- mypyc/codegen/emitwrapper.py +979 -0
- mypyc/codegen/literals.py +302 -0
- mypyc/common.py +136 -0
- mypyc/crash.py +31 -0
- mypyc/doc/Makefile +20 -0
- mypyc/doc/bool_operations.rst +27 -0
- mypyc/doc/compilation_units.rst +20 -0
- mypyc/doc/conf.py +59 -0
- mypyc/doc/cpython-timings.md +25 -0
- mypyc/doc/dev-intro.md +548 -0
- mypyc/doc/dict_operations.rst +59 -0
- mypyc/doc/differences_from_python.rst +332 -0
- mypyc/doc/float_operations.rst +50 -0
- mypyc/doc/future.md +42 -0
- mypyc/doc/getting_started.rst +240 -0
- mypyc/doc/index.rst +61 -0
- mypyc/doc/int_operations.rst +162 -0
- mypyc/doc/introduction.rst +150 -0
- mypyc/doc/list_operations.rst +65 -0
- mypyc/doc/make.bat +35 -0
- mypyc/doc/native_classes.rst +206 -0
- mypyc/doc/native_operations.rst +55 -0
- mypyc/doc/performance_tips_and_tricks.rst +244 -0
- mypyc/doc/set_operations.rst +47 -0
- mypyc/doc/str_operations.rst +35 -0
- mypyc/doc/tuple_operations.rst +33 -0
- mypyc/doc/using_type_annotations.rst +398 -0
- mypyc/errors.py +29 -0
- mypyc/external/googletest/LICENSE +28 -0
- mypyc/external/googletest/README.md +280 -0
- mypyc/external/googletest/include/gtest/gtest-death-test.h +294 -0
- mypyc/external/googletest/include/gtest/gtest-message.h +250 -0
- mypyc/external/googletest/include/gtest/gtest-param-test.h +1444 -0
- mypyc/external/googletest/include/gtest/gtest-param-test.h.pump +510 -0
- mypyc/external/googletest/include/gtest/gtest-printers.h +993 -0
- mypyc/external/googletest/include/gtest/gtest-spi.h +232 -0
- mypyc/external/googletest/include/gtest/gtest-test-part.h +179 -0
- mypyc/external/googletest/include/gtest/gtest-typed-test.h +263 -0
- mypyc/external/googletest/include/gtest/gtest.h +2236 -0
- mypyc/external/googletest/include/gtest/gtest_pred_impl.h +358 -0
- mypyc/external/googletest/include/gtest/gtest_prod.h +58 -0
- mypyc/external/googletest/include/gtest/internal/custom/gtest-port.h +69 -0
- mypyc/external/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
- mypyc/external/googletest/include/gtest/internal/custom/gtest.h +41 -0
- mypyc/external/googletest/include/gtest/internal/gtest-death-test-internal.h +319 -0
- mypyc/external/googletest/include/gtest/internal/gtest-filepath.h +206 -0
- mypyc/external/googletest/include/gtest/internal/gtest-internal.h +1238 -0
- mypyc/external/googletest/include/gtest/internal/gtest-linked_ptr.h +243 -0
- mypyc/external/googletest/include/gtest/internal/gtest-param-util-generated.h +5146 -0
- mypyc/external/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +286 -0
- mypyc/external/googletest/include/gtest/internal/gtest-param-util.h +731 -0
- mypyc/external/googletest/include/gtest/internal/gtest-port-arch.h +93 -0
- mypyc/external/googletest/include/gtest/internal/gtest-port.h +2560 -0
- mypyc/external/googletest/include/gtest/internal/gtest-string.h +167 -0
- mypyc/external/googletest/include/gtest/internal/gtest-tuple.h +1020 -0
- mypyc/external/googletest/include/gtest/internal/gtest-tuple.h.pump +347 -0
- mypyc/external/googletest/include/gtest/internal/gtest-type-util.h +3331 -0
- mypyc/external/googletest/include/gtest/internal/gtest-type-util.h.pump +297 -0
- mypyc/external/googletest/make/Makefile +61 -0
- mypyc/external/googletest/src/gtest-all.cc +48 -0
- mypyc/external/googletest/src/gtest-death-test.cc +1342 -0
- mypyc/external/googletest/src/gtest-filepath.cc +387 -0
- mypyc/external/googletest/src/gtest-internal-inl.h +1183 -0
- mypyc/external/googletest/src/gtest-port.cc +1259 -0
- mypyc/external/googletest/src/gtest-printers.cc +373 -0
- mypyc/external/googletest/src/gtest-test-part.cc +110 -0
- mypyc/external/googletest/src/gtest-typed-test.cc +118 -0
- mypyc/external/googletest/src/gtest.cc +5388 -0
- mypyc/external/googletest/src/gtest_main.cc +38 -0
- mypyc/ir/__init__.py +0 -0
- mypyc/ir/class_ir.py +499 -0
- mypyc/ir/func_ir.py +370 -0
- mypyc/ir/module_ir.py +88 -0
- mypyc/ir/ops.py +1642 -0
- mypyc/ir/pprint.py +496 -0
- mypyc/ir/rtypes.py +1038 -0
- mypyc/irbuild/__init__.py +0 -0
- mypyc/irbuild/ast_helpers.py +120 -0
- mypyc/irbuild/builder.py +1398 -0
- mypyc/irbuild/callable_class.py +173 -0
- mypyc/irbuild/classdef.py +850 -0
- mypyc/irbuild/constant_fold.py +95 -0
- mypyc/irbuild/context.py +186 -0
- mypyc/irbuild/env_class.py +223 -0
- mypyc/irbuild/expression.py +1067 -0
- mypyc/irbuild/for_helpers.py +1046 -0
- mypyc/irbuild/format_str_tokenizer.py +250 -0
- mypyc/irbuild/function.py +1089 -0
- mypyc/irbuild/generator.py +346 -0
- mypyc/irbuild/ll_builder.py +2407 -0
- mypyc/irbuild/main.py +153 -0
- mypyc/irbuild/mapper.py +221 -0
- mypyc/irbuild/match.py +355 -0
- mypyc/irbuild/nonlocalcontrol.py +197 -0
- mypyc/irbuild/prebuildvisitor.py +203 -0
- mypyc/irbuild/prepare.py +609 -0
- mypyc/irbuild/specialize.py +822 -0
- mypyc/irbuild/statement.py +1017 -0
- mypyc/irbuild/targets.py +57 -0
- mypyc/irbuild/util.py +189 -0
- mypyc/irbuild/visitor.py +401 -0
- mypyc/irbuild/vtable.py +82 -0
- mypyc/lib-rt/CPy.h +643 -0
- mypyc/lib-rt/bytes_ops.c +143 -0
- mypyc/lib-rt/dict_ops.c +446 -0
- mypyc/lib-rt/exc_ops.c +259 -0
- mypyc/lib-rt/float_ops.c +192 -0
- mypyc/lib-rt/generic_ops.c +64 -0
- mypyc/lib-rt/getargs.c +450 -0
- mypyc/lib-rt/getargsfast.c +569 -0
- mypyc/lib-rt/init.c +13 -0
- mypyc/lib-rt/int_ops.c +803 -0
- mypyc/lib-rt/list_ops.c +335 -0
- mypyc/lib-rt/misc_ops.c +942 -0
- mypyc/lib-rt/module_shim.tmpl +18 -0
- mypyc/lib-rt/mypyc_util.h +118 -0
- mypyc/lib-rt/pythoncapi_compat.h +497 -0
- mypyc/lib-rt/pythonsupport.h +548 -0
- mypyc/lib-rt/set_ops.c +17 -0
- mypyc/lib-rt/setup.py +70 -0
- mypyc/lib-rt/str_ops.c +241 -0
- mypyc/lib-rt/test_capi.cc +585 -0
- mypyc/lib-rt/tuple_ops.c +61 -0
- mypyc/namegen.py +115 -0
- mypyc/options.py +32 -0
- mypyc/primitives/__init__.py +0 -0
- mypyc/primitives/bytes_ops.py +101 -0
- mypyc/primitives/dict_ops.py +325 -0
- mypyc/primitives/exc_ops.py +101 -0
- mypyc/primitives/float_ops.py +168 -0
- mypyc/primitives/generic_ops.py +384 -0
- mypyc/primitives/int_ops.py +304 -0
- mypyc/primitives/list_ops.py +300 -0
- mypyc/primitives/misc_ops.py +241 -0
- mypyc/primitives/registry.py +323 -0
- mypyc/primitives/set_ops.py +121 -0
- mypyc/primitives/str_ops.py +229 -0
- mypyc/primitives/tuple_ops.py +83 -0
- mypyc/rt_subtype.py +77 -0
- mypyc/sametype.py +83 -0
- mypyc/subtype.py +88 -0
- mypyc/test/__init__.py +0 -0
- mypyc/test/config.py +13 -0
- mypyc/test/test_alwaysdefined.py +46 -0
- mypyc/test/test_analysis.py +77 -0
- mypyc/test/test_cheader.py +45 -0
- mypyc/test/test_commandline.py +82 -0
- mypyc/test/test_emit.py +69 -0
- mypyc/test/test_emitclass.py +35 -0
- mypyc/test/test_emitfunc.py +926 -0
- mypyc/test/test_emitwrapper.py +60 -0
- mypyc/test/test_exceptions.py +56 -0
- mypyc/test/test_external.py +49 -0
- mypyc/test/test_irbuild.py +87 -0
- mypyc/test/test_ircheck.py +199 -0
- mypyc/test/test_literals.py +90 -0
- mypyc/test/test_namegen.py +48 -0
- mypyc/test/test_pprint.py +42 -0
- mypyc/test/test_rarray.py +48 -0
- mypyc/test/test_refcount.py +59 -0
- mypyc/test/test_run.py +426 -0
- mypyc/test/test_serialization.py +108 -0
- mypyc/test/test_struct.py +112 -0
- mypyc/test/test_tuplename.py +33 -0
- mypyc/test/test_typeops.py +97 -0
- mypyc/test/testutil.py +283 -0
- mypyc/test-data/alwaysdefined.test +732 -0
- mypyc/test-data/analysis.test +603 -0
- mypyc/test-data/commandline.test +245 -0
- mypyc/test-data/driver/driver.py +48 -0
- mypyc/test-data/exceptions-freq.test +125 -0
- mypyc/test-data/exceptions.test +713 -0
- mypyc/test-data/fixtures/ir.py +373 -0
- mypyc/test-data/fixtures/testutil.py +103 -0
- mypyc/test-data/fixtures/typing-full.pyi +169 -0
- mypyc/test-data/irbuild-any.test +238 -0
- mypyc/test-data/irbuild-basic.test +3690 -0
- mypyc/test-data/irbuild-bool.test +463 -0
- mypyc/test-data/irbuild-bytes.test +184 -0
- mypyc/test-data/irbuild-classes.test +1303 -0
- mypyc/test-data/irbuild-constant-fold.test +480 -0
- mypyc/test-data/irbuild-dict.test +585 -0
- mypyc/test-data/irbuild-dunders.test +223 -0
- mypyc/test-data/irbuild-float.test +497 -0
- mypyc/test-data/irbuild-generics.test +151 -0
- mypyc/test-data/irbuild-glue-methods.test +437 -0
- mypyc/test-data/irbuild-i16.test +526 -0
- mypyc/test-data/irbuild-i32.test +598 -0
- mypyc/test-data/irbuild-i64.test +2164 -0
- mypyc/test-data/irbuild-int.test +235 -0
- mypyc/test-data/irbuild-isinstance.test +109 -0
- mypyc/test-data/irbuild-lists.test +547 -0
- mypyc/test-data/irbuild-match.test +1708 -0
- mypyc/test-data/irbuild-math.test +64 -0
- mypyc/test-data/irbuild-nested.test +807 -0
- mypyc/test-data/irbuild-optional.test +536 -0
- mypyc/test-data/irbuild-set.test +838 -0
- mypyc/test-data/irbuild-singledispatch.test +257 -0
- mypyc/test-data/irbuild-statements.test +1149 -0
- mypyc/test-data/irbuild-str.test +314 -0
- mypyc/test-data/irbuild-strip-asserts.test +12 -0
- mypyc/test-data/irbuild-try.test +523 -0
- mypyc/test-data/irbuild-tuple.test +462 -0
- mypyc/test-data/irbuild-u8.test +543 -0
- mypyc/test-data/irbuild-unreachable.test +241 -0
- mypyc/test-data/irbuild-vectorcall.test +153 -0
- mypyc/test-data/refcount.test +1588 -0
- mypyc/test-data/run-async.test +145 -0
- mypyc/test-data/run-attrs.test +318 -0
- mypyc/test-data/run-bench.test +196 -0
- mypyc/test-data/run-bools.test +229 -0
- mypyc/test-data/run-bytes.test +302 -0
- mypyc/test-data/run-classes.test +2505 -0
- mypyc/test-data/run-dicts.test +334 -0
- mypyc/test-data/run-dunders.test +945 -0
- mypyc/test-data/run-exceptions.test +448 -0
- mypyc/test-data/run-floats.test +516 -0
- mypyc/test-data/run-functions.test +1310 -0
- mypyc/test-data/run-generators.test +681 -0
- mypyc/test-data/run-i16.test +338 -0
- mypyc/test-data/run-i32.test +336 -0
- mypyc/test-data/run-i64.test +1519 -0
- mypyc/test-data/run-imports.test +265 -0
- mypyc/test-data/run-integers.test +540 -0
- mypyc/test-data/run-lists.test +411 -0
- mypyc/test-data/run-loops.test +485 -0
- mypyc/test-data/run-match.test +283 -0
- mypyc/test-data/run-math.test +106 -0
- mypyc/test-data/run-misc.test +1168 -0
- mypyc/test-data/run-multimodule.test +887 -0
- mypyc/test-data/run-mypy-sim.test +138 -0
- mypyc/test-data/run-primitives.test +375 -0
- mypyc/test-data/run-python37.test +159 -0
- mypyc/test-data/run-python38.test +88 -0
- mypyc/test-data/run-sets.test +150 -0
- mypyc/test-data/run-singledispatch.test +698 -0
- mypyc/test-data/run-strings.test +641 -0
- mypyc/test-data/run-traits.test +411 -0
- mypyc/test-data/run-tuples.test +258 -0
- mypyc/test-data/run-u8.test +303 -0
- mypyc/transform/__init__.py +0 -0
- mypyc/transform/exceptions.py +182 -0
- mypyc/transform/refcount.py +294 -0
- mypyc/transform/uninit.py +190 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Final, FrozenSet, Tuple, Union
|
|
4
|
+
from typing_extensions import TypeGuard
|
|
5
|
+
|
|
6
|
+
# Supported Python literal types. All tuple / frozenset items must have supported
|
|
7
|
+
# literal types as well, but we can't represent the type precisely.
|
|
8
|
+
LiteralValue = Union[
|
|
9
|
+
str, bytes, int, bool, float, complex, Tuple[object, ...], FrozenSet[object], None
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _is_literal_value(obj: object) -> TypeGuard[LiteralValue]:
|
|
14
|
+
return isinstance(obj, (str, bytes, int, float, complex, tuple, frozenset, type(None)))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# Some literals are singletons and handled specially (None, False and True)
|
|
18
|
+
NUM_SINGLETONS: Final = 3
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Literals:
|
|
22
|
+
"""Collection of literal values used in a compilation group and related helpers."""
|
|
23
|
+
|
|
24
|
+
def __init__(self) -> None:
|
|
25
|
+
# Each dict maps value to literal index (0, 1, ...)
|
|
26
|
+
self.str_literals: dict[str, int] = {}
|
|
27
|
+
self.bytes_literals: dict[bytes, int] = {}
|
|
28
|
+
self.int_literals: dict[int, int] = {}
|
|
29
|
+
self.float_literals: dict[float, int] = {}
|
|
30
|
+
self.complex_literals: dict[complex, int] = {}
|
|
31
|
+
self.tuple_literals: dict[tuple[object, ...], int] = {}
|
|
32
|
+
self.frozenset_literals: dict[frozenset[object], int] = {}
|
|
33
|
+
|
|
34
|
+
def record_literal(self, value: LiteralValue) -> None:
|
|
35
|
+
"""Ensure that the literal value is available in generated code."""
|
|
36
|
+
if value is None or value is True or value is False:
|
|
37
|
+
# These are special cased and always present
|
|
38
|
+
return
|
|
39
|
+
if isinstance(value, str):
|
|
40
|
+
str_literals = self.str_literals
|
|
41
|
+
if value not in str_literals:
|
|
42
|
+
str_literals[value] = len(str_literals)
|
|
43
|
+
elif isinstance(value, bytes):
|
|
44
|
+
bytes_literals = self.bytes_literals
|
|
45
|
+
if value not in bytes_literals:
|
|
46
|
+
bytes_literals[value] = len(bytes_literals)
|
|
47
|
+
elif isinstance(value, int):
|
|
48
|
+
int_literals = self.int_literals
|
|
49
|
+
if value not in int_literals:
|
|
50
|
+
int_literals[value] = len(int_literals)
|
|
51
|
+
elif isinstance(value, float):
|
|
52
|
+
float_literals = self.float_literals
|
|
53
|
+
if value not in float_literals:
|
|
54
|
+
float_literals[value] = len(float_literals)
|
|
55
|
+
elif isinstance(value, complex):
|
|
56
|
+
complex_literals = self.complex_literals
|
|
57
|
+
if value not in complex_literals:
|
|
58
|
+
complex_literals[value] = len(complex_literals)
|
|
59
|
+
elif isinstance(value, tuple):
|
|
60
|
+
tuple_literals = self.tuple_literals
|
|
61
|
+
if value not in tuple_literals:
|
|
62
|
+
for item in value:
|
|
63
|
+
assert _is_literal_value(item)
|
|
64
|
+
self.record_literal(item)
|
|
65
|
+
tuple_literals[value] = len(tuple_literals)
|
|
66
|
+
elif isinstance(value, frozenset):
|
|
67
|
+
frozenset_literals = self.frozenset_literals
|
|
68
|
+
if value not in frozenset_literals:
|
|
69
|
+
for item in value:
|
|
70
|
+
assert _is_literal_value(item)
|
|
71
|
+
self.record_literal(item)
|
|
72
|
+
frozenset_literals[value] = len(frozenset_literals)
|
|
73
|
+
else:
|
|
74
|
+
assert False, "invalid literal: %r" % value
|
|
75
|
+
|
|
76
|
+
def literal_index(self, value: LiteralValue) -> int:
|
|
77
|
+
"""Return the index to the literals array for given value."""
|
|
78
|
+
# The array contains first None and booleans, followed by all str values,
|
|
79
|
+
# followed by bytes values, etc.
|
|
80
|
+
if value is None:
|
|
81
|
+
return 0
|
|
82
|
+
elif value is False:
|
|
83
|
+
return 1
|
|
84
|
+
elif value is True:
|
|
85
|
+
return 2
|
|
86
|
+
n = NUM_SINGLETONS
|
|
87
|
+
if isinstance(value, str):
|
|
88
|
+
return n + self.str_literals[value]
|
|
89
|
+
n += len(self.str_literals)
|
|
90
|
+
if isinstance(value, bytes):
|
|
91
|
+
return n + self.bytes_literals[value]
|
|
92
|
+
n += len(self.bytes_literals)
|
|
93
|
+
if isinstance(value, int):
|
|
94
|
+
return n + self.int_literals[value]
|
|
95
|
+
n += len(self.int_literals)
|
|
96
|
+
if isinstance(value, float):
|
|
97
|
+
return n + self.float_literals[value]
|
|
98
|
+
n += len(self.float_literals)
|
|
99
|
+
if isinstance(value, complex):
|
|
100
|
+
return n + self.complex_literals[value]
|
|
101
|
+
n += len(self.complex_literals)
|
|
102
|
+
if isinstance(value, tuple):
|
|
103
|
+
return n + self.tuple_literals[value]
|
|
104
|
+
n += len(self.tuple_literals)
|
|
105
|
+
if isinstance(value, frozenset):
|
|
106
|
+
return n + self.frozenset_literals[value]
|
|
107
|
+
assert False, "invalid literal: %r" % value
|
|
108
|
+
|
|
109
|
+
def num_literals(self) -> int:
|
|
110
|
+
# The first three are for None, True and False
|
|
111
|
+
return (
|
|
112
|
+
NUM_SINGLETONS
|
|
113
|
+
+ len(self.str_literals)
|
|
114
|
+
+ len(self.bytes_literals)
|
|
115
|
+
+ len(self.int_literals)
|
|
116
|
+
+ len(self.float_literals)
|
|
117
|
+
+ len(self.complex_literals)
|
|
118
|
+
+ len(self.tuple_literals)
|
|
119
|
+
+ len(self.frozenset_literals)
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
# The following methods return the C encodings of literal values
|
|
123
|
+
# of different types
|
|
124
|
+
|
|
125
|
+
def encoded_str_values(self) -> list[bytes]:
|
|
126
|
+
return _encode_str_values(self.str_literals)
|
|
127
|
+
|
|
128
|
+
def encoded_int_values(self) -> list[bytes]:
|
|
129
|
+
return _encode_int_values(self.int_literals)
|
|
130
|
+
|
|
131
|
+
def encoded_bytes_values(self) -> list[bytes]:
|
|
132
|
+
return _encode_bytes_values(self.bytes_literals)
|
|
133
|
+
|
|
134
|
+
def encoded_float_values(self) -> list[str]:
|
|
135
|
+
return _encode_float_values(self.float_literals)
|
|
136
|
+
|
|
137
|
+
def encoded_complex_values(self) -> list[str]:
|
|
138
|
+
return _encode_complex_values(self.complex_literals)
|
|
139
|
+
|
|
140
|
+
def encoded_tuple_values(self) -> list[str]:
|
|
141
|
+
return self._encode_collection_values(self.tuple_literals)
|
|
142
|
+
|
|
143
|
+
def encoded_frozenset_values(self) -> list[str]:
|
|
144
|
+
return self._encode_collection_values(self.frozenset_literals)
|
|
145
|
+
|
|
146
|
+
def _encode_collection_values(
|
|
147
|
+
self, values: dict[tuple[object, ...], int] | dict[frozenset[object], int]
|
|
148
|
+
) -> list[str]:
|
|
149
|
+
"""Encode tuple/frozenset values into a C array.
|
|
150
|
+
|
|
151
|
+
The format of the result is like this:
|
|
152
|
+
|
|
153
|
+
<number of collections>
|
|
154
|
+
<length of the first collection>
|
|
155
|
+
<literal index of first item>
|
|
156
|
+
...
|
|
157
|
+
<literal index of last item>
|
|
158
|
+
<length of the second collection>
|
|
159
|
+
...
|
|
160
|
+
"""
|
|
161
|
+
value_by_index = {index: value for value, index in values.items()}
|
|
162
|
+
result = []
|
|
163
|
+
count = len(values)
|
|
164
|
+
result.append(str(count))
|
|
165
|
+
for i in range(count):
|
|
166
|
+
value = value_by_index[i]
|
|
167
|
+
result.append(str(len(value)))
|
|
168
|
+
for item in value:
|
|
169
|
+
assert _is_literal_value(item)
|
|
170
|
+
index = self.literal_index(item)
|
|
171
|
+
result.append(str(index))
|
|
172
|
+
return result
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def _encode_str_values(values: dict[str, int]) -> list[bytes]:
|
|
176
|
+
value_by_index = {index: value for value, index in values.items()}
|
|
177
|
+
result = []
|
|
178
|
+
line: list[bytes] = []
|
|
179
|
+
line_len = 0
|
|
180
|
+
for i in range(len(values)):
|
|
181
|
+
value = value_by_index[i]
|
|
182
|
+
c_literal = format_str_literal(value)
|
|
183
|
+
c_len = len(c_literal)
|
|
184
|
+
if line_len > 0 and line_len + c_len > 70:
|
|
185
|
+
result.append(format_int(len(line)) + b"".join(line))
|
|
186
|
+
line = []
|
|
187
|
+
line_len = 0
|
|
188
|
+
line.append(c_literal)
|
|
189
|
+
line_len += c_len
|
|
190
|
+
if line:
|
|
191
|
+
result.append(format_int(len(line)) + b"".join(line))
|
|
192
|
+
result.append(b"")
|
|
193
|
+
return result
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def _encode_bytes_values(values: dict[bytes, int]) -> list[bytes]:
|
|
197
|
+
value_by_index = {index: value for value, index in values.items()}
|
|
198
|
+
result = []
|
|
199
|
+
line: list[bytes] = []
|
|
200
|
+
line_len = 0
|
|
201
|
+
for i in range(len(values)):
|
|
202
|
+
value = value_by_index[i]
|
|
203
|
+
c_init = format_int(len(value))
|
|
204
|
+
c_len = len(c_init) + len(value)
|
|
205
|
+
if line_len > 0 and line_len + c_len > 70:
|
|
206
|
+
result.append(format_int(len(line)) + b"".join(line))
|
|
207
|
+
line = []
|
|
208
|
+
line_len = 0
|
|
209
|
+
line.append(c_init + value)
|
|
210
|
+
line_len += c_len
|
|
211
|
+
if line:
|
|
212
|
+
result.append(format_int(len(line)) + b"".join(line))
|
|
213
|
+
result.append(b"")
|
|
214
|
+
return result
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
def format_int(n: int) -> bytes:
|
|
218
|
+
"""Format an integer using a variable-length binary encoding."""
|
|
219
|
+
if n < 128:
|
|
220
|
+
a = [n]
|
|
221
|
+
else:
|
|
222
|
+
a = []
|
|
223
|
+
while n > 0:
|
|
224
|
+
a.insert(0, n & 0x7F)
|
|
225
|
+
n >>= 7
|
|
226
|
+
for i in range(len(a) - 1):
|
|
227
|
+
# If the highest bit is set, more 7-bit digits follow
|
|
228
|
+
a[i] |= 0x80
|
|
229
|
+
return bytes(a)
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def format_str_literal(s: str) -> bytes:
|
|
233
|
+
utf8 = s.encode("utf-8")
|
|
234
|
+
return format_int(len(utf8)) + utf8
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def _encode_int_values(values: dict[int, int]) -> list[bytes]:
|
|
238
|
+
"""Encode int values into C strings.
|
|
239
|
+
|
|
240
|
+
Values are stored in base 10 and separated by 0 bytes.
|
|
241
|
+
"""
|
|
242
|
+
value_by_index = {index: value for value, index in values.items()}
|
|
243
|
+
result = []
|
|
244
|
+
line: list[bytes] = []
|
|
245
|
+
line_len = 0
|
|
246
|
+
for i in range(len(values)):
|
|
247
|
+
value = value_by_index[i]
|
|
248
|
+
encoded = b"%d" % value
|
|
249
|
+
if line_len > 0 and line_len + len(encoded) > 70:
|
|
250
|
+
result.append(format_int(len(line)) + b"\0".join(line))
|
|
251
|
+
line = []
|
|
252
|
+
line_len = 0
|
|
253
|
+
line.append(encoded)
|
|
254
|
+
line_len += len(encoded)
|
|
255
|
+
if line:
|
|
256
|
+
result.append(format_int(len(line)) + b"\0".join(line))
|
|
257
|
+
result.append(b"")
|
|
258
|
+
return result
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
def float_to_c(x: float) -> str:
|
|
262
|
+
"""Return C literal representation of a float value."""
|
|
263
|
+
s = str(x)
|
|
264
|
+
if s == "inf":
|
|
265
|
+
return "INFINITY"
|
|
266
|
+
elif s == "-inf":
|
|
267
|
+
return "-INFINITY"
|
|
268
|
+
elif s == "nan":
|
|
269
|
+
return "NAN"
|
|
270
|
+
return s
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
def _encode_float_values(values: dict[float, int]) -> list[str]:
|
|
274
|
+
"""Encode float values into a C array values.
|
|
275
|
+
|
|
276
|
+
The result contains the number of values followed by individual values.
|
|
277
|
+
"""
|
|
278
|
+
value_by_index = {index: value for value, index in values.items()}
|
|
279
|
+
result = []
|
|
280
|
+
num = len(values)
|
|
281
|
+
result.append(str(num))
|
|
282
|
+
for i in range(num):
|
|
283
|
+
value = value_by_index[i]
|
|
284
|
+
result.append(float_to_c(value))
|
|
285
|
+
return result
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
def _encode_complex_values(values: dict[complex, int]) -> list[str]:
|
|
289
|
+
"""Encode float values into a C array values.
|
|
290
|
+
|
|
291
|
+
The result contains the number of values followed by pairs of doubles
|
|
292
|
+
representing complex numbers.
|
|
293
|
+
"""
|
|
294
|
+
value_by_index = {index: value for value, index in values.items()}
|
|
295
|
+
result = []
|
|
296
|
+
num = len(values)
|
|
297
|
+
result.append(str(num))
|
|
298
|
+
for i in range(num):
|
|
299
|
+
value = value_by_index[i]
|
|
300
|
+
result.append(float_to_c(value.real))
|
|
301
|
+
result.append(float_to_c(value.imag))
|
|
302
|
+
return result
|
mypyc/common.py
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
import sysconfig
|
|
5
|
+
from typing import Any, Dict, Final
|
|
6
|
+
|
|
7
|
+
from mypy.util import unnamed_function
|
|
8
|
+
|
|
9
|
+
PREFIX: Final = "CPyPy_" # Python wrappers
|
|
10
|
+
NATIVE_PREFIX: Final = "CPyDef_" # Native functions etc.
|
|
11
|
+
DUNDER_PREFIX: Final = "CPyDunder_" # Wrappers for exposing dunder methods to the API
|
|
12
|
+
REG_PREFIX: Final = "cpy_r_" # Registers
|
|
13
|
+
STATIC_PREFIX: Final = "CPyStatic_" # Static variables (for literals etc.)
|
|
14
|
+
TYPE_PREFIX: Final = "CPyType_" # Type object struct
|
|
15
|
+
MODULE_PREFIX: Final = "CPyModule_" # Cached modules
|
|
16
|
+
ATTR_PREFIX: Final = "_" # Attributes
|
|
17
|
+
|
|
18
|
+
ENV_ATTR_NAME: Final = "__mypyc_env__"
|
|
19
|
+
NEXT_LABEL_ATTR_NAME: Final = "__mypyc_next_label__"
|
|
20
|
+
TEMP_ATTR_NAME: Final = "__mypyc_temp__"
|
|
21
|
+
LAMBDA_NAME: Final = "__mypyc_lambda__"
|
|
22
|
+
PROPSET_PREFIX: Final = "__mypyc_setter__"
|
|
23
|
+
SELF_NAME: Final = "__mypyc_self__"
|
|
24
|
+
|
|
25
|
+
# Max short int we accept as a literal is based on 32-bit platforms,
|
|
26
|
+
# so that we can just always emit the same code.
|
|
27
|
+
|
|
28
|
+
TOP_LEVEL_NAME: Final = "__top_level__" # Special function representing module top level
|
|
29
|
+
|
|
30
|
+
# Maximal number of subclasses for a class to trigger fast path in isinstance() checks.
|
|
31
|
+
FAST_ISINSTANCE_MAX_SUBCLASSES: Final = 2
|
|
32
|
+
|
|
33
|
+
# Size of size_t, if configured.
|
|
34
|
+
SIZEOF_SIZE_T_SYSCONFIG: Final = sysconfig.get_config_var("SIZEOF_SIZE_T")
|
|
35
|
+
|
|
36
|
+
SIZEOF_SIZE_T: Final = (
|
|
37
|
+
int(SIZEOF_SIZE_T_SYSCONFIG)
|
|
38
|
+
if SIZEOF_SIZE_T_SYSCONFIG is not None
|
|
39
|
+
else (sys.maxsize + 1).bit_length() // 8
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
IS_32_BIT_PLATFORM: Final = int(SIZEOF_SIZE_T) == 4
|
|
43
|
+
|
|
44
|
+
PLATFORM_SIZE = 4 if IS_32_BIT_PLATFORM else 8
|
|
45
|
+
|
|
46
|
+
# Maximum value for a short tagged integer.
|
|
47
|
+
MAX_SHORT_INT: Final = 2 ** (8 * int(SIZEOF_SIZE_T) - 2) - 1
|
|
48
|
+
|
|
49
|
+
# Minimum value for a short tagged integer.
|
|
50
|
+
MIN_SHORT_INT: Final = -(MAX_SHORT_INT) - 1
|
|
51
|
+
|
|
52
|
+
# Maximum value for a short tagged integer represented as a C integer literal.
|
|
53
|
+
#
|
|
54
|
+
# Note: Assume that the compiled code uses the same bit width as mypyc
|
|
55
|
+
MAX_LITERAL_SHORT_INT: Final = MAX_SHORT_INT
|
|
56
|
+
MIN_LITERAL_SHORT_INT: Final = -MAX_LITERAL_SHORT_INT - 1
|
|
57
|
+
|
|
58
|
+
# Description of the C type used to track the definedness of attributes and
|
|
59
|
+
# the presence of argument default values that have types with overlapping
|
|
60
|
+
# error values. Each tracked attribute/argument has a dedicated bit in the
|
|
61
|
+
# relevant bitmap.
|
|
62
|
+
BITMAP_TYPE: Final = "uint32_t"
|
|
63
|
+
BITMAP_BITS: Final = 32
|
|
64
|
+
|
|
65
|
+
# Runtime C library files
|
|
66
|
+
RUNTIME_C_FILES: Final = [
|
|
67
|
+
"init.c",
|
|
68
|
+
"getargs.c",
|
|
69
|
+
"getargsfast.c",
|
|
70
|
+
"int_ops.c",
|
|
71
|
+
"float_ops.c",
|
|
72
|
+
"str_ops.c",
|
|
73
|
+
"bytes_ops.c",
|
|
74
|
+
"list_ops.c",
|
|
75
|
+
"dict_ops.c",
|
|
76
|
+
"set_ops.c",
|
|
77
|
+
"tuple_ops.c",
|
|
78
|
+
"exc_ops.c",
|
|
79
|
+
"misc_ops.c",
|
|
80
|
+
"generic_ops.c",
|
|
81
|
+
]
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
JsonDict = Dict[str, Any]
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def shared_lib_name(group_name: str) -> str:
|
|
88
|
+
"""Given a group name, return the actual name of its extension module.
|
|
89
|
+
|
|
90
|
+
(This just adds a suffix to the final component.)
|
|
91
|
+
"""
|
|
92
|
+
return f"{group_name}__mypyc"
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def short_name(name: str) -> str:
|
|
96
|
+
if name.startswith("builtins."):
|
|
97
|
+
return name[9:]
|
|
98
|
+
return name
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def use_vectorcall(capi_version: tuple[int, int]) -> bool:
|
|
102
|
+
# We can use vectorcalls to make calls on Python 3.8+ (PEP 590).
|
|
103
|
+
return capi_version >= (3, 8)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def use_method_vectorcall(capi_version: tuple[int, int]) -> bool:
|
|
107
|
+
# We can use a dedicated vectorcall API to call methods on Python 3.9+.
|
|
108
|
+
return capi_version >= (3, 9)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def get_id_from_name(name: str, fullname: str, line: int) -> str:
|
|
112
|
+
"""Create a unique id for a function.
|
|
113
|
+
|
|
114
|
+
This creates an id that is unique for any given function definition, so that it can be used as
|
|
115
|
+
a dictionary key. This is usually the fullname of the function, but this is different in that
|
|
116
|
+
it handles the case where the function is named '_', in which case multiple different functions
|
|
117
|
+
could have the same name."""
|
|
118
|
+
if unnamed_function(name):
|
|
119
|
+
return f"{fullname}.{line}"
|
|
120
|
+
else:
|
|
121
|
+
return fullname
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def short_id_from_name(func_name: str, shortname: str, line: int | None) -> str:
|
|
125
|
+
if unnamed_function(func_name):
|
|
126
|
+
assert line is not None
|
|
127
|
+
partial_name = f"{shortname}.{line}"
|
|
128
|
+
else:
|
|
129
|
+
partial_name = shortname
|
|
130
|
+
return partial_name
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def bitmap_name(index: int) -> str:
|
|
134
|
+
if index == 0:
|
|
135
|
+
return "__bitmap"
|
|
136
|
+
return f"__bitmap{index + 1}"
|
mypyc/crash.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
import traceback
|
|
5
|
+
from contextlib import contextmanager
|
|
6
|
+
from typing import Iterator, NoReturn
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@contextmanager
|
|
10
|
+
def catch_errors(module_path: str, line: int) -> Iterator[None]:
|
|
11
|
+
try:
|
|
12
|
+
yield
|
|
13
|
+
except Exception:
|
|
14
|
+
crash_report(module_path, line)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def crash_report(module_path: str, line: int) -> NoReturn:
|
|
18
|
+
# Adapted from report_internal_error in mypy
|
|
19
|
+
err = sys.exc_info()[1]
|
|
20
|
+
tb = traceback.extract_stack()[:-4]
|
|
21
|
+
# Excise all the traceback from the test runner
|
|
22
|
+
for i, x in enumerate(tb):
|
|
23
|
+
if x.name == "pytest_runtest_call":
|
|
24
|
+
tb = tb[i + 1 :]
|
|
25
|
+
break
|
|
26
|
+
tb2 = traceback.extract_tb(sys.exc_info()[2])[1:]
|
|
27
|
+
print("Traceback (most recent call last):")
|
|
28
|
+
for s in traceback.format_list(tb + tb2):
|
|
29
|
+
print(s.rstrip("\n"))
|
|
30
|
+
print(f"{module_path}:{line}: {type(err).__name__}: {err}")
|
|
31
|
+
raise SystemExit(2)
|
mypyc/doc/Makefile
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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)
|
|
@@ -0,0 +1,27 @@
|
|
|
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 ...)``
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.. _compilation-units:
|
|
2
|
+
|
|
3
|
+
Compilation units
|
|
4
|
+
=================
|
|
5
|
+
|
|
6
|
+
When you run mypyc to compile a set of modules, these modules form a
|
|
7
|
+
*compilation unit*. Mypyc will use early binding for references within
|
|
8
|
+
the compilation unit.
|
|
9
|
+
|
|
10
|
+
If you run mypyc multiple times to compile multiple sets of modules,
|
|
11
|
+
each invocation will result in a new compilation unit. References
|
|
12
|
+
between separate compilation units will fall back to late binding,
|
|
13
|
+
i.e. looking up names using Python namespace dictionaries. Also, all
|
|
14
|
+
calls will use the slower Python calling convention, where arguments
|
|
15
|
+
and the return value will be boxed (and potentially unboxed again in
|
|
16
|
+
the called function).
|
|
17
|
+
|
|
18
|
+
For maximal performance, minimize interactions across compilation
|
|
19
|
+
units. The simplest way to achieve this is to compile your entire
|
|
20
|
+
program as a single compilation unit.
|
mypyc/doc/conf.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Configuration file for the Sphinx documentation builder.
|
|
2
|
+
#
|
|
3
|
+
# This file only contains a selection of the most common options. For a full
|
|
4
|
+
# list see the documentation:
|
|
5
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import os
|
|
10
|
+
import sys
|
|
11
|
+
|
|
12
|
+
# If extensions (or modules to document with autodoc) are in another directory,
|
|
13
|
+
# add these directories to sys.path here. If the directory is relative to the
|
|
14
|
+
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
15
|
+
sys.path.insert(0, os.path.abspath("../.."))
|
|
16
|
+
|
|
17
|
+
from mypy.version import __version__ as mypy_version
|
|
18
|
+
|
|
19
|
+
# -- Project information -----------------------------------------------------
|
|
20
|
+
|
|
21
|
+
project = "mypyc"
|
|
22
|
+
copyright = "2020-2022, mypyc team"
|
|
23
|
+
author = "mypyc team"
|
|
24
|
+
|
|
25
|
+
# The version info for the project you're documenting, acts as replacement for
|
|
26
|
+
# |version| and |release|, also used in various other places throughout the
|
|
27
|
+
# built documents.
|
|
28
|
+
#
|
|
29
|
+
# The short X.Y version.
|
|
30
|
+
version = mypy_version.split("-")[0]
|
|
31
|
+
# The full version, including alpha/beta/rc tags.
|
|
32
|
+
release = mypy_version
|
|
33
|
+
|
|
34
|
+
# -- General configuration ---------------------------------------------------
|
|
35
|
+
|
|
36
|
+
# Add any Sphinx extension module names here, as strings. They can be
|
|
37
|
+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
|
38
|
+
# ones.
|
|
39
|
+
extensions = [] # type: ignore[var-annotated]
|
|
40
|
+
|
|
41
|
+
# Add any paths that contain templates here, relative to this directory.
|
|
42
|
+
templates_path = ["_templates"]
|
|
43
|
+
|
|
44
|
+
# List of patterns, relative to source directory, that match files and
|
|
45
|
+
# directories to ignore when looking for source files.
|
|
46
|
+
# This pattern also affects html_static_path and html_extra_path.
|
|
47
|
+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# -- Options for HTML output -------------------------------------------------
|
|
51
|
+
|
|
52
|
+
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
53
|
+
# a list of builtin themes.
|
|
54
|
+
html_theme = "furo"
|
|
55
|
+
|
|
56
|
+
# Add any paths that contain custom static files (such as style sheets) here,
|
|
57
|
+
# relative to this directory. They are copied after the builtin static files,
|
|
58
|
+
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
59
|
+
html_static_path = ["_static"]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Timings of CPython Operations
|
|
2
|
+
|
|
3
|
+
Here are some *very rough* approximate timings of CPython interpreter
|
|
4
|
+
operations:
|
|
5
|
+
|
|
6
|
+
* `f(1)` (empty function body): 70-90ns
|
|
7
|
+
* `f(n=1)` (empty function body): 90-110ns
|
|
8
|
+
* `o.x`: 30-40ns
|
|
9
|
+
* `o.f(1)` (empty method body): 80-160ns
|
|
10
|
+
* `Cls(1)` (initialize attribute in `__init__`): 290-330ns
|
|
11
|
+
* `x + y` (integers): 20-35ns
|
|
12
|
+
* `a[i]` (list) : 20-40ns
|
|
13
|
+
* `[i]` (also dealloc): 35-55ns
|
|
14
|
+
* `a.append(i)` (list, average over 5 appends): 70ns
|
|
15
|
+
* `d[s]` (dict, shared str key): 20ns
|
|
16
|
+
* `d[s] = i` (dict, shared str key): 40ns
|
|
17
|
+
* `isinstance(x, A)`: 100ns
|
|
18
|
+
* `(x, y)`: 20-35ns
|
|
19
|
+
* `x, y = t` (tuple expand): 10ns
|
|
20
|
+
|
|
21
|
+
Note that these results are very imprecise due to many factors, but
|
|
22
|
+
these should give a rough idea of the relative costs of various
|
|
23
|
+
operations.
|
|
24
|
+
|
|
25
|
+
Details: CPython 3.6.2, Macbook Pro 15" (Mid 2015), macOS Sierra
|