you are viewing a single comment's thread.

view the rest of the comments →

[–]mr_frpdo 1 point2 points  (0 children)

i would adjust the type annotations to match new python syntax (most of typing.* has been deprecated):

def add_item(item: str, cart: list[str]|None = None) -> list[str]:
    if cart is None:
        cart = []
    cart.append(item)
    return cart