This is like Interface in Go (or Java, i don’t speak Java but the article say so).

  • nikaroOP
    link
    fedilink
    arrow-up
    1
    ·
    2 years ago

    From what i understand, Protocol is for custom interfaces that you define (this object must have do_x() method), while ABCs are generic (this object is iterable).

      • nikaroOP
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        The difference is that with Protocol you can define which method presence you want to ensure. Like i said: custom vs. generic.