Can you explain it to me like i’m a 10 yrs old (which i’m not 🙄), then?
Can you explain it to me like i’m a 10 yrs old (which i’m not 🙄), then?
The difference is that with Protocol
you can define which method presence you want to ensure. Like i said: custom vs. generic.
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).
Certainly not the best, but codecademy is decent. After that, it should be enough for you to learn more deeply from official Python documentation, actual Python code base (from OSS repositories), and specific subjects from blog articles.
But it will highly depend on what type of content you like. For example some people may prefer books over interactive courses. If this is your case, i think this one is recognized as a very good one: https://learnpythonthehardway.org/python3/