MonkeyType:用于Python的系统,通过收集运行时类型来生成静态类型注释

时间:2021-03-31 19:31:00
【文件属性】:
文件名称:MonkeyType:用于Python的系统,通过收集运行时类型来生成静态类型注释
文件大小:105KB
文件格式:ZIP
更新时间:2021-03-31 19:31:00
Python 猴子类型 MonkeyType收集函数参数和返回值的运行时类型,并可以基于运行时收集的类型自动生成存根文件,甚至可以将草稿类型注释直接添加到您的Python代码中。 例子 说some/module.py最初包含: def add ( a , b ): return a + b 并且myscript.py包含: from some . module import add add ( 1 , 2 ) 现在,我们想通过使用MonkeyType运行myscript.py来推断some/module.py中add的类型注释。 一种方法是运行: $ monkeytype run myscript.py 默认情况下,这会将调用跟踪记录转储到当前工作目录中文件monkeytype.sqlite3中SQLite数据库中。 然后,您可以使用monkeytype命令为模块生成存根文件,或将类
【文件预览】:
MonkeyType-master
----setup.py(2KB)
----.gitignore(173B)
----pyproject.toml(100B)
----CHANGES.rst(6KB)
----CODE_OF_CONDUCT.md(243B)
----LICENSE(1KB)
----Pipfile.lock(40KB)
----doc()
--------generation.rst(7KB)
--------Makefile(607B)
--------index.rst(482B)
--------conf.py(6KB)
--------configuration.rst(7KB)
--------make.bat(1KB)
--------tracing.rst(7KB)
--------faq.rst(2KB)
--------stores.rst(6KB)
----RELEASING.rst(1KB)
----monkeytype()
--------compat.py(5KB)
--------__init__.py(943B)
--------db()
--------typing.pyi(4KB)
--------stubs.py(32KB)
--------encoding.py(8KB)
--------typing.py(16KB)
--------cli.py(14KB)
--------config.py(5KB)
--------util.py(3KB)
--------tracing.py(9KB)
--------py.typed(0B)
--------__main__.py(264B)
--------exceptions.py(348B)
----demo()
--------requirements.txt(291B)
--------setup.cfg(28B)
--------models.py(3KB)
--------README.md(2KB)
--------pytest.ini(88B)
--------inbox.py(5KB)
--------test_inbox.py(8KB)
--------mypy.ini(58B)
----README.rst(4KB)
----tests()
--------conftest.py(347B)
--------cythontest.pyx(340B)
--------test_cli.py(13KB)
--------__init__.py(0B)
--------test_config.py(1KB)
--------db()
--------test_util.py(3KB)
--------test_typing.py(30KB)
--------util.py(2KB)
--------test_tracing.py(10KB)
--------test_stubs.py(48KB)
--------test_encoding.py(9KB)
--------testmodule()
----pytest.ini(103B)
----Pipfile(346B)
----CONTRIBUTING.rst(3KB)
----.circleci()
--------config.yml(4KB)
----.flake8(109B)
----tox.ini(114B)
----mypy.ini(324B)

网友评论