10.3. Sequences

10.3.1. One-dimensional sequences

10.3.1.1. List

my_list: list = ['a', 2, 3.3]
from typing import List

my_list: List[int] = [1, 2, 3]
my_list: List[float] = [1.1, 2.2, 3.3]
my_list: List[str] = ['a', 'b', 'c']

10.3.1.2. Set

my_set: set = {'a', 2, 3.3}
from typing import Set

my_set: Set[int] = {1, 2, 3}
my_set: Set[float] = {1.1, 2.2, 3.3}
my_set: Set[str] = {'a', 'b', 'c'}

10.3.1.3. Tuple

my_tuple: tuple = 'a', 2, 3.3
my_tuple: tuple = ('a', 2, 3.3)
from typing import Tuple

my_tuple: Tuple[int, int, int] = (1, 2, 3)
my_tuple: Tuple[float, float, float] = (1.1, 2.2, 3.3)
my_tuple: Tuple[str, str, str] = ('a', 'b', 'c')

my_tuple: Tuple[str, int, float] = ('a', 2, 3.3)
from typing import Sequence


def fire_employees(e: Sequence[Employee]) -> None:
    print(employee)

10.3.2. Multidimensional sequences

10.3.2.1. List of dict

from typing import List

list_of_dicts: List[dict] = [
    {'a': 1},
    {2: 'b'},
    {3.3: 'c'}
]
from typing import List, Dict

list_of_dicts: List[Dict[str, int]] = [
    {'a': 1},
    {'b': 2},
    {'c': 3},
]

10.3.2.2. List of tuples

from typing import List

my_data: List[tuple] = [
    (1, 2, 3),
    (1.1, 2.2, 3.3),
    ('a', 'b', 'c'),
    ('a', 2, 3.3),
]
from typing import List, Tuple

my_data: List[Tuple[int, int, int]] = [
    (1, 2, 3),
    (1, 2, 3),
    (1, 2, 3),
]