Стандартная библиотека asyncio это стандарт (начиная с Py3.4) для работы с асинхронным кодом. Но эта библиотека достаточно низкоуровневая, со своими проблемами, устаревшими подходами.
Чтобы исправить это, были созданы разные обертки и альтернативы с реализацией популярных инструментов и паттернов асинхронного программирования. Это такие библиотеки как:
- trio: улучшает корректность выполнения, не оставляя потерянных корутин при ошибках, то есть предлагает Structured Concurrency из коробки.
- curio: упрощение синтаксиса и читаемости кода, больше похоже на работу с потоками.
- anyio: универсальная обертка над asyncio или trio плюс множество вспомогательных инструментов.
anyio используется в FastAPI как основная библиотека для работы с асинхронным кодом и вызовом синхронного кода из асинхронного.
В общем, рекомендую почитать про возможности anyio, возможно вы более не будете использовать чистый asyncio в своих проектах)
Это совсем не значит что дефолтный asyncio плох, он тоже даёт достаточный для работы функционал и продолжает развиваться. Например, в версии 3.11 появились TaskGroup, с похожим на trio функционалом. Так что он тоже актуален, просто придется больше написать кода самостоятельно.
#libs#async
#South Africa
The penguin colony of more than 3,000 individuals lives on the beach of Bolders. The penguins adapted to the climate perfectly and does not experience any problems and worries at all.
#South Korea
🇰🇷🤝🇺🇿
🇺🇿 Janubiy Koreyaning Lotte foundation mukofoti “Koreys filologiyasi” yoʻnalishi talabalariga topshirildi.
—
🇷🇺 Премия южнокорейского фонда Lotte foundation вручена студентам факультета «Корейская филология»
—
🇬🇧 The scholarship of Lotte Foundation (South Korea) was presented to students of the Faculty of Korean Philology.
👩💼Read more: www.kiut.uz
20 casualties among Israeli soldiers after Hezbollah thwarted their infiltration attempt in Adaisseh, on the Lebanese border.
#Israel#Lebanon#Hezbollah#South
South Africa may choose Russia and Iran for its nuclear project
South Africa is considering cooperation with Russia and Iran to expand its civilian nuclear capacity, a move that could complicate relations with the United States and delay the renewal of a strategic energy deal between the countries, Reuters reports.
South Africa, home to the continent's only nuclear power plant, the Koeberg, is planning to add 2,500 megawatts of new capacity to combat power outages and reduce emissions. The country has announced a tender and, according to Minerals and Petroleum Resources Minister Gwede Mantashe, Russia and Iran will not be excluded from it.
"If their proposals are the best, we will choose them," he stressed.
The statement has caused concern in Washington. Earlier, US President Donald Trump signed an executive order limiting aid to South Africa, citing its alleged military and nuclear cooperation with Iran. South African authorities have denied the allegations.
A South African nuclear tender planned for last year has been delayed by legal wrangling. Meanwhile, work is underway on a new US-South African nuclear cooperation agreement (the 123 Agreement), which is needed to export nuclear technology and fuel from the US.
The previous agreement expired in 2022. According to Zizamele Mbambo, an official in the South African Department of Energy, the negotiations have been completed at a technical level, but the signing is being delayed by legal procedures.
Analysts say South Africa's decision to turn to Russia and Iran could heighten geopolitical tensions and slow the restoration of cooperation with the US.
#AREA#South Africa #Russia#Iran#USA
News: #Tigray institutions renew calls for dialogue, reconciliation amid continued internal clashes
Religious and civic institutions in Tigray have renewed calls for dialogue and an end to internal fighting, urging combatants to halt hostilities and pursue reconciliation as clashes continue in parts of the region, despite recent signs of de-escalation in the #south.
The Synod of the #Selama Tigray Orthodox Tewahedo Church, following an emergency meeting, said that “the mutual destruction occurring between brothers must stop,” and announced plans to actively engage in efforts to end the killings.
In a statement shared with journalists, the Synod said that as people in Tigray face one of the gravest crises in recent history, it is seeking to foster understanding and reconciliation to bring an end to internal violence.
Similarly, Tigray #Public_Diplomacy issued an emergency statement titled “Stop the War: Let Us Return to Dialogue,” recalling an earlier...
Read more: https://addisstandard.com/?p=55017