Static type checking
All functions and global objects must be type annotated. Types must be checked statically using MyPy with the following (or stricter) settings (example shown is an excerpt from `setup
[mypy] warn_return_any = True warn_unused_configs = True disallow_untyped_defs = True check_untyped_defs = True no_implicit_optional = True warn_redundant_casts = True warn_unused_ignores = True
Usage of tabs is not allowed. If you're porting an existing codebase, replace all tabs with 4 spaces. PEP8 recommends to retain tabs when working with an existing codebase.
Always provide a blank line after the end of every indented block, unless the following code is related to the indented block. For example, there should be an empty space after the end of an
if block, unless it is followed by its
def foo(): try: if a == b: bar() else: baz() if a == c: booz() except ValueError as ex: print(ex) return False else: return True
Every text file should contain exactly one empty line at the end.