Generics — typing documentation
reveal_type(first([1, 2, 3])) # Revealed type is "builtins.int" reveal_type(first(['a', 'b'])) # Revealed type is "builtins.str". Since type variables are about describing the relationship between two or more types, it’s usually not useful to have a type variable only appear once in a function signature.