From
// primitive function def uga_uga(text):
to
def uga_uga(text: str) -> int: """ Very primitive AI. :param text: Input text :return: Number parsed by primitive AI """
from typing import Tuple def returns_tuple(input: str) -> Tuple[str, str]:
def i_have_side_effects(path: str) -> None:
import pyspark from pyspark.sql.column import Column def do_stuff(sc: pyspark.SparkContext, path: str) -> Column:
def dirty_function(cleanup=True):
def dirty_function(cleanup: bool=True) -> Something:
The value of cleanup is True not the value of bool! Another disadvantage of types after variable name.
cleanup
True
bool
def Tuple[str, str] returns_tuple(str:input = "default") :
Original presentation on github gist: