Cheatography
https://cheatography.com
MyPy Tool
|
Command line to check syntax |
|
Be Verbose |
-any-exprs-report PATH
|
Provide a path to generate a coverage
report |
This tool will show you Type Errors found in the code. If verbose
is off and the command returns nothing, the code is OK.
Type Definition
from typing import Dict, List, Tuple
|
Import types definition |
|
|
|
|
var: Tuple[str, float, int] = ()
|
|
|
Define a custom 'Type` |
|
|
def function(arg: str) -> int:
|
Define a function that takes an str
and returns an int
|
|
The Any
type accepts all types |
|
This Union
type accepts either a str
or an int
|
pip install mypy
pip install typing
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by amicheletti