Typing

Optional static typing for Python.

136 resources10 categoriesView Original

Articles(34 items)

1

1-minute guide to real constants in Python

Full tutorial about `Final` constants and inheritance.

Articles
A

Adam Johnsons Blog

Adam Johnson blogs about typing practices.

Articles
A

Adding type hints to urllib3

Tests are not enough: Case study adding type hints to urllib3.

Articles
O

Our journey to type checking 4 million lines of...

Dropbox has been one of the first companies to adopt Python static type checking at this scale.

Articles
P

ParamSpec Guide

Newly released feature in `PEP612` allows you do a lot of advanced typing things with functions and their signatures.

Articles
P

PEP-3107

Function Annotations.

Articles
P

PEP-482

Literature Overview for Type Hints.

Articles
P

PEP-483

The Theory of Type Hints.

Articles
P

PEP-484

Type Hints.

Articles
P

PEP-526

Syntax for Variable Annotations.

Articles
P

PEP-544

Protocols: Structural subtyping (static duck typing).

Articles
P

PEP-557

Data Classes.

Articles
P

PEP-560

Core support for typing module and generic types.

Articles
P

PEP-561

Distributing and Packaging Type Information.

Articles
P

PEP-563

Postponed Evaluation of Annotations.

Articles
P

PEP-585

Type Hinting Generics In Standard Collections.

Articles
P

PEP-586

Literal Types.

Articles
P

PEP-589

TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys.

Articles
P

PEP-591

Adding a final qualifier to typing.

Articles
P

PEP-593

Flexible function and variable annotations.

Articles
P

PEP-604

Complementary syntax for Union[].

Articles
P

PEP-612

Parameter Specification Variables.

Articles
P

PEP-613

Explicit Type Aliases.

Articles
P

PyTest MonkeyType Introduction

Type Annotate an existing Python Django Codebase with MonkeyType.

Articles
P

Python Type Checking (Guide)

In this guide, you will get a look into Python type checking.

Articles
P

Python-typing-koans

A set of examples to learn optional static typing in Python.

Articles
S

Simple dependent types in Python

Full tutorial about `Literal` types.

Articles
S

Static Typing Python Decorators

Accurately static typing decorators in Python is an icky business. The wrapper function obfuscates type information required to statically determine the types of the parameters and the return values of the wrapped function.

Articles
T

Testing mypy stubs, plugins, and types

Full tutorial about testing mypy types.

Articles
T

The state of type hints in Python

As of May 2018.

Articles
T

Type Check Your Django Application

An article based on two recent talks on adding type checks to Django.

Articles
T

Type hints cheat sheet

Cheat sheet on writing type annotations by MyPy team.

Articles
T

Typechecking Django and DRF

Full tutorial about type-checking django.

Articles
T

typing

Official Python documentation for `typing` module.

Articles

Tools(46 items)

A

auto-optional

Makes typed arguments Optional when the default argument is `None`.

Tools
A

autotyping

Automatically add simple return type annotations for functions (bool, None, Optional).

Tools
C

com2ann

Tool for translation of type comments to type annotations.

Tools
F

flake8-annotations

Plugin for flake8 to check for presence of type annotations in function definitions.

Tools
F

flake8-annotations-complexity

Plugin for flake8 to validate annotations complexity.

Tools
F

flake8-pyi

Plugin for Flake8 that provides specializations for type hinting stub files.

Tools
F

flake8-type-checking

Plugin to help you guard any type-annotation-only import correctly.

Tools
F

flake8-type-ignore

flake8 plugin to disallow type: ignore comments in your typed Python code.

Tools
F

flake8-typing-imports

Plugin which checks that typing imports are properly guarded.

Tools
F

flake8-typing-only-imports

flake8 plugin that helps identify which imports to put into type-checking blocks, and how to adjust your type annotations once imports are moved.

Tools
I

infer-types

CLI tool to automatically infer and add type annotations into Python code.

Tools
J

jsonschema-gentypes

Generate Python types based on TypedDict from a JSON Schema.

Tools
K

kubernetes-typed

Plugin for kubernetes CRD type checking.

Tools
L

loguru-mypy

Plugin for loguru support.

Tools
M

merge-pyi

Part of pytype toolchain, applies stub files onto source code.

Tools
M

monkeytype

Collects runtime types of function arguments and return values, and can automatically generate stub files or even add draft type annotations directly to your code based on the types collected at runtime.

Tools
M

mypy-baseline

Integrate mypy with existing codebase. A CLI tool that filters out existing type errors and reports only new ones.

Tools
M

mypy-protobuf

Tool to generate mypy stubs from protobufs.

Tools
M

mypy-silent

Silence mypy by adding or removing code comments.

Tools
M

mypy-test

Test mypy plugins, stubs, custom types.

Tools
M

mypy-zope

Plugin for zope.interface support.

Tools
M

mypy/plugins

Plugins already integrated into mypy.

Tools
M

mypyc

Compiles mypy-annotated, statically typed Python modules into CPython C extensions.

Tools
N

no_implicit_optional

A codemod to make your implicit optional type hints PEP 484 compliant.

Tools
N

numpy

Plugin for NumPy support.

Tools
P

pyannotate

Insert annotations into your source code based on call arguments and return types observed at runtime.

Tools
P

pydantic

Plugin for additional Pydantic support.

Tools
P

pynamodb-mypy

Plugin for PynamoDB support.

Tools
P

pyre infer

Pyre has a powerful feature for migrating codebases to a typed format. The infer command-line option ingests a file or directory, makes educated guesses about the types used, and applies the annotations to the files.

Tools
P

pytest-annotate

Pyannotate plugin for pytest.

Tools
P

pytest-monkeytype

MonkeyType plugin for pytest.

Tools
P

pytest-mypy

Mypy static type checker plugin for Pytest.

Tools
P

pytest-mypy-plugins

Pytest plugin for testing mypy types, stubs, and plugins.

Tools
P

pytest-mypy-testing

Pytest plugin to test mypy static type analysis.

Tools
P

pytype annotate-ast

A work-in-progress tool to annotate the nodes of an AST with their Python types.

Tools
P

PyTypes

Infer Types by Python Tracing.

Tools
R

retype

Another tool to apply stubs to code.

Tools
R

RightTyper

A tool that generates types for your function arguments and return values. RightTyper lets your code run at nearly full speed with almost no memory overhead.

Tools
R

Ruff

Extremely fast linter which supports lint rules from many other lint tools, such as flake8.

Tools
T

type4py

Deep Similarity Learning-Based Type Inference.

Tools
T

typeforce

CLI tool that enriches your Python environment with type annotations, empowering mypy.

Tools
T

typesplainer

A Python type explainer.

Tools
T

typilus

A deep learning algorithm for predicting types in Python. Also available as a GitHub action

Tools
T

typing-inspect

The typing_inspect module defines experimental API for runtime inspection of types defined in the `typing` module.

Tools
T

typing-json

Lib for working with typed objects and JSON.

Tools
W

wemake-python-styleguide

The strictest and most opinionated Python linter ever.

Tools