An open API service indexing awesome lists of open source software.

https://github.com/madi-s/protocols-vs-abc


https://github.com/madi-s/protocols-vs-abc

abc protocols python python-typing

Last synced: 6 months ago
JSON representation

Awesome Lists containing this project

README

          

# protocls-vs-abc

A common question among the Python developers is whether to use protocols or abc module and when to put each of these two in a proper way.

Have a look at `abc_usecase.py` and `protocls_usecase.py` to grasp the difference and when it is suitable situtation for abc or protocols use.

Keep in mind, they serve the same purpose but are different in a way, so it is essential to understand when to use which tool.

Protocols are almost the same as abc, but allows you to use ducktyping instead of explicit typing.