Mypy 1.8.0 Documentation
Welcome to mypy documentation! Mypy is a static type checker for Python. Type checkers help ensure that you’re using variables and functions in your code correctly. With mypy, add type hints (PEP 484 Python programs, and mypy will warn you when you use those types incorrectly. Python is a dynamic language, so usually you’ll only see errors in your code when you attempt to run it. Mypy is a static checker hints for mypy does not interfere with the way your program would otherwise run. Think of type hints as similar to comments! You can always use the Python interpreter to run your code, even if mypy reports0 码力 | 318 页 | 271.55 KB | 1 年前3Mypy 1.8.0 Documentation
Mypy Documentation Release 1.8.0 Jukka Dec 21, 2023 FIRST STEPS 1 Contents 3 1.1 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3 Using mypy with an existing codebase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 . . . . . . . . . . . . . 111 1.20 Running mypy and managing imports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 1.21 The mypy command line . . . . . . . . . . . . . . .0 码力 | 234 页 | 902.89 KB | 1 年前3Mypy 1.10.0+dev Documentation
Welcome to mypy documentation! Mypy is a static type checker for Python. Type checkers help ensure that you’re using variables and functions in your code correctly. With mypy, add type hints (PEP 484 Python programs, and mypy will warn you when you use those types incorrectly. Python is a dynamic language, so usually you’ll only see errors in your code when you attempt to run it. Mypy is a static checker hints for mypy does not interfere with the way your program would otherwise run. Think of type hints as similar to comments! You can always use the Python interpreter to run your code, even if mypy reports0 码力 | 318 页 | 270.84 KB | 1 年前3Mypy 1.10.0+dev Documentation
Mypy Documentation Release 1.10.0+dev.790e8a73d8671a41cae419b4ea07579bfb2bc292.dirty Jukka Feb 20, 2024 FIRST STEPS 1 Contents 3 1.1 Getting started . . . . . . . . . . . . . . . . . . . . . . . sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3 Using mypy with an existing codebase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 . . . . . . . . . . . . . 111 1.20 Running mypy and managing imports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 1.21 The mypy command line . . . . . . . . . . . . . . .0 码力 | 234 页 | 913.89 KB | 1 年前35 刘知杭 静态类型的Python
静态类型的Python Lyzh(刘知杭) 目录 CONTENTS 有关类型的概念 使用mypy对Python源 代码进行静态分析 代数数据类型 拓展知识 关于类型的一些基本概念 有类型不等于有类型系统 动态语言类型化的必要性 不久前的一个案例 正文 类型的概念 CPython定义了PyObject这个 结构体作为对象头。 CPython中的类型,是指在对 象头中指向类型元信息的指针。 类型系统的分类——声明式类型系统与结构化类型系统 声明类型系统通过名字来检查类型 鸭子类型——一个object,你看它长得像鸭子,行为也像鸭子,那他就是鸭子。 结构类型系统检查类型的形状而非名字 MYPY与Python标准支持 Python标准——指PEP484和PEP3107 PEP 3107 – Function Annotations 由于Python2中缺少缺少注释函数参数和返回值的标准,因此出现了各种工具和库来填 该PEP旨在为类型注释提供标准语法,开放Python代码以简化静态分析和重构,潜 在的运行时类型检查,以及(可能在某些情况下)利用类型信息生成代码。 在这些目标中,静态分析是最重要的。这包括对类型检查器(如mypy)的支持, 以及提供可由IDE实现的代码重构操作。 虽然这些注释可以在运行时通过 __annotations__ 属性拿到,但在运行时不会进行 类型检查。相反,该提案假定存在一个单独的第三方的类型检查器,用户可以自由0 码力 | 42 页 | 6.87 MB | 1 年前3Cooperative C++ Evolution
== 2 x == 1.5 Manual migration + tools (2to3, Pylint, Futurize, Modernize, caniusepython3, tox, mypy) 2017: Most Python code still written in “23” 2020: 2.x frozen and unsupported 2023: Still used == 2 x == 1.5 Manual migration + tools (2to3, Pylint, Futurize, Modernize, caniusepython3, tox, mypy) 2017: Most Python code still written in “23” 2020: 2.x frozen and unsupported 2023: Still used == 2 x == 1.5 Manual migration + tools (2to3, Pylint, Futurize, Modernize, caniusepython3, tox, mypy) 2017: Most Python code still written in “23” 2020: 2.x frozen and unsupported 2023: Still used0 码力 | 85 页 | 5.73 MB | 5 月前303. 杜逸先 Python3 的新特性和改进
type hints Python3的新特性和改进——新的理念和编程方法 type hints:代码即文档 Python3的新特性和改进——新的理念和编程方法 type hints:使用mypy进行静态类型检查 Python3的新特性和改进——新的理念和编程方法 type hints:更好地利用IDE 2 Python3的新特性和改进 ——其他变化 Python3的新特性和改进——其他变化0 码力 | 78 页 | 2.28 MB | 1 年前3Tornado 6.1 Documentation
changes Tornado now includes type annotations compatible with mypy. These annotations will be used when type-checking your application with mypy, and may be usable in editors and other tools. Tornado now Availability: Unix """ if sys.platform == "win32": # The exact form of this condition matters to mypy; it understands # if but not assert in this context. raise Exception("fork not available typing.TYPE_CHECKING: # Coroutine wasn't added to typing until 3.5.3, so only import it # when mypy is running and use forward references. from typing import Coroutine # noqa: F401 _ExcInfoTuple0 码力 | 931 页 | 708.03 KB | 1 年前306. 李欣宜 扩展Python的语法和语义
works for Linux users) 4 下班时在干什么? 有没有空? 可以来contribute吗? 添加一个新的扩展? 理由? 实际的use case? 为扩展添加静态检查支持(mypy plugins)? 文档? THANK YOU thautwarm: - github.com/thautwarm - twshere@outlook.com 李欣宜: - github0 码力 | 39 页 | 3.69 MB | 1 年前3The Python Handbook
annotate variables: count: int = 0 Python will ignore those annotations. A separate tool called mypy can be run standalone, or integrated by IDE like VS Code or PyCharm to automatically check for0 码力 | 93 页 | 7.31 MB | 1 年前3
共 70 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7