Python interfaces: abandon ABC and switch to Protocols

<p>I used a standard Python library&nbsp;<code>abc</code>&nbsp;to define interfaces for the last 10 years of my career. But recently, I found that relatively new Python&nbsp;<a href="https://peps.python.org/pep-0544/" rel="noopener ugc nofollow" target="_blank">Protocols</a>&nbsp;are way nicer. People find uses for both technologies. But I want to convince you to completely jump ships and start using them instead of more traditional techniques.</p> <h1>Python interfaces: what can you use?</h1> <p>Python is somewhat different from other popular languages since there are no interfaces on a language level. But there are several library implementations. The&nbsp;<code>abc</code>&nbsp;package is probably the most popular:</p> <p><a href="https://medium.com/gitconnected/python-interfaces-choose-protocols-over-abc-3982e112342e"><strong>Read More</strong></a></p>
Tags: abandon