Стандартная библиотека asyncio это стандарт (начиная с Py3.4) для работы с асинхронным кодом. Но эта библиотека достаточно низкоуровневая, со своими проблемами, устаревшими подходами.
Чтобы исправить это, были созданы разные обертки и альтернативы с реализацией популярных инструментов и паттернов асинхронного программирования. Это такие библиотеки как:
- trio: улучшает корректность выполнения, не оставляя потерянных корутин при ошибках, то есть предлагает Structured Concurrency из коробки.
- curio: упрощение синтаксиса и читаемости кода, больше похоже на работу с потоками.
- anyio: универсальная обертка над asyncio или trio плюс множество вспомогательных инструментов.
anyio используется в FastAPI как основная библиотека для работы с асинхронным кодом и вызовом синхронного кода из асинхронного.
В общем, рекомендую почитать про возможности anyio, возможно вы более не будете использовать чистый asyncio в своих проектах)
Это совсем не значит что дефолтный asyncio плох, он тоже даёт достаточный для работы функционал и продолжает развиваться. Например, в версии 3.11 появились TaskGroup, с похожим на trio функционалом. Так что он тоже актуален, просто придется больше написать кода самостоятельно.
#libs#async
👳♀14-fevral – Zahiriddin Muhammad Bobur tavallud topgan kun
Bobur (1483–1530) – buyuk o‘zbek shoiri, mutafakkir, tarixshunos va davlat arbobi, Boburiylar sulolasi asoschisi.
“Boburnoma” va g‘azallari orqali u sevgi, vatan, inson qadri va adolat g‘oyalarini tarannum etdi.
Bobur merosi millatimiz iftixori
__________
👳♀14 февраля - день рождения Захириддина Мухаммада Бабура
Бабур (1483-1530) - великий узбекский поэт, мыслитель, историк и государственный деятель, основатель династии Бабуридов.
Через "Бабур-наме" и газели он воспевал идеи любви, родины, человеческого достоинства и справедливости.
Наследие Бабура - гордость нашего народа
__________
👳♀February 14 - Zahiriddin Muhammad Babur's birthday
Babur (1483-1530) - a great Uzbek poet, thinker, historian and statesman, founder of the Baburid dynasty.
Through his "Baburnama" and ghazals, he celebrated the ideas of love, homeland, human dignity and justice.
Babur's legacy is the pride of our nation
#GSBE#GraduateSchool#Babur#King#Poet
🔝Web-site |🔝Facebook | 🔝Instagram | 🔝Youtube
Part 2: Babur, at age 13, wrote in the Baburnama about his feelings for a boy named Baburi:
> “In those leisurely days, I discovered in myself a strange inclination — nay! as the verse says, ‘I maddened and afflicted myself’ — for a boy in the camp‑bazar, his very name, Bāburī, fitting in. Up till then I had had no inclination for anyone… From time to time Bāburi came to my presence but out of modesty I could never look straight at him… I got so confused that I almost went right off.”
💌📖👑
Note: this does not mean he was homosexual. Such feelings can be a normal part of teenage self-discovery.
@googlefactss
#Baburnama#Babur#MughalHistory#HistoricalFacts#LoveInHistory#Memoir#HonestWriting
Part 1: Babur, the Mughal emperor and a Muslim, wrote the Baburnama, a detailed personal memoir. In it, he shared his feelings openly. He wrote about his love and admiration for women. He also felt strong affection and admiration for a boy named Baburi. He described these emotions with honesty and detail. He sometimes wrote poems about his feelings. His writing shows both his emotional sensitivity and his poetic talent. He mixed personal experiences, romantic feelings, and reflections on life. Babur’s memoir is considered important for both history and literature. It gives a rare glimpse into his private thoughts, he was not afraid to show his personal desires and emotions. Both his relationships with women and his emotional attachment to Baburi are part of the memoir. His writing style is clear, candid, and expressive. The writings are valued for its literary quality and honesty.
💌📖👑🕌
[Read more1]
[Read more2]
@googlefactss
#Baburnama#Babur#MughalHistory#HistoricalFacts#LoveInHistory#Memoir#Islam