this post was submitted on 15 Sep 2023
34 points (97.2% liked)

Python

6215 readers
56 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

๐Ÿ“… Events

October 2023

November 2023

PastJuly 2023

August 2023

September 2023

๐Ÿ Python project:
๐Ÿ’“ Python Community:
โœจ Python Ecosystem:
๐ŸŒŒ Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
 

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

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 0 points 1 year ago* (last edited 1 year ago) (1 children)

@nikaro iterable means: has __iter__() method. So there's no real difference, as far as I can see.

[โ€“] [email protected] 1 points 1 year ago

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