[Python] Iterable[str] vs [str]

Discussão em 'Python' iniciado por Stack, Fevereiro 2, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to understand the difference between:

    from typing import Iterable
    def func(self, stuff: Iterable[str]) -> str:


    and:

    def func(self, stuff: [str]) -> str:


    Are both statements valid? Do they give the same information to Python (3.12+) interpreter?

    Continue reading...

Compartilhe esta Página