Salta al contenuto

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone

Python

1 Discussioni 1 Post View Original

<p>Welcome to the <a href="https://programming.dev/c/python" rel="nofollow">Python community</a> on the programming.dev Lemmy instance!</p>
<h5><a href="https://pycon.org/#calendar" rel="nofollow">📅 Events</a></h5>
<details><summary>Past</summary><p>November 2023

  • Static Protocols in Python: Behaviour Over Inheritance

    1
    0 Votazioni
    1 Post
    4 Visualizzazioni
    rimu@piefed.social
    Protocols have something to do with typing. With protocols, you can check whether an object is valid based on whether it has the right methods and attributes. The idea is to check for behaviour instead of inheritance. Protocols extend Python's type hints by allowing to define structural types.