IT-новости про Python, которые стоит знать

Собрали в одном месте самые важные ссылки
и сделали Тренажер IT-инцидентов для DevOps/SRE

     24.01.2023       Выпуск 475 (23.01.2023 - 29.01.2023)       Статьи

Fixing Circular Imports in Python with Protocol

The problem started when I had two classes that needed to talk to each other. Sometimes, classes need to talk to each other in both directions. The following example is made up, but mostly behaves like the original problem. Let’s say I have a Director and an Actor. The Director tells the Actor to do_action(). In order to do the action, the Actor needs to get_data() from the Director. Here’s our director.