Protocol Or ABC In Python - When to Use Which One?

Published: 29 October 2021
on channel: ArjanCodes
204,285
6.7k

💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide.

When should you use protocol classes vs abstract base classes? Here's an example where I use both, talk about the trade-offs, and give you a suggestion of when to use each of them.

The code I worked on in this video is available here: https://github.com/ArjanCodes/2021-pr....

🎓 ArjanCodes Courses: https://www.arjancodes.com/courses/

🔖 Chapters:
0:00 Intro
2:01 Explaining the example
5:56 About abstract base classes
8:47 Protocols, nominal typing and structural typing
10:41 Using protocols
15:34 Splitting the Device class
20:05 When to use protocols vs abstract base classes

#arjancodes #softwaredesign #python


Watch video Protocol Or ABC In Python - When to Use Which One? online without registration, duration hours minute second in high quality. This video was added by user ArjanCodes 29 October 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 204,28 once and liked it 6.7 thousand people.