Custom
- Using the
typing
library you can import types for data structures and custom types more than just the standard primitive types
Custom Typing
from typing import List
Vector = List[float]
def foo(v: Vector) -> Vector:
print(v)
Can also use our own custom types like this:
from typing import List
Vector = List[float]
Vectors = List[Vector]
def foo(v: Vectors) -> Vectors:
print(v)