TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #424 · 13 апр.

Стандартная библиотека asyncio это стандарт (начиная с Py3.4) для работы с асинхронным кодом. Но эта библиотека достаточно низкоуровневая, со своими проблемами, устаревшими подходами. Чтобы исправить это, были созданы разные обертки и альтернативы с реализацией популярных инструментов и паттернов асинхронного программирования. Это такие библиотеки как: - trio: улучшает корректность выполнения, не оставляя потерянных корутин при ошибках, то есть предлагает Structured Concurrency из коробки. - curio: упрощение синтаксиса и читаемости кода, больше похоже на работу с потоками. - anyio: универсальная обертка над asyncio или trio плюс множество вспомогательных инструментов. anyio используется в FastAPI как основная библиотека для работы с асинхронным кодом и вызовом синхронного кода из асинхронного. В общем, рекомендую почитать про возможности anyio, возможно вы более не будете использовать чистый asyncio в своих проектах) Это совсем не значит что дефолтный asyncio плох, он тоже даёт достаточный для работы функционал и продолжает развиваться. Например, в версии 3.11 появились TaskGroup, с похожим на trio функционалом. Так что он тоже актуален, просто придется больше написать кода самостоятельно. #libs#async

Hashtags

Резултати

Пронајдени 1 слични објави

Пребарај: #questionanswer

当前筛选 #questionanswer清除筛选

🌟New avatar and sections for our channel! 🌟 Dear applicants! 🎉 We are happy to present you our new avatar! Now our channel looks even more attractive and modern💫. But that's not all! We have also created a number of informative sections to make the content more interesting and useful for you🤗. The following sections will be implemented on our channel: ❓#QuestionAnswer - ask your questions and get answers! 📚#MigrationAccounting - we will tell you about the peculiarities of migration registration and stay of foreign students on the territory of the Russian Federation. 🏆#Olympiad - you will get up-to-date information about the ONLINE-OLIMPIAD "FEMIDA" for citizens of foreign countries. 📜#AcceptingForeigners - we will provide you with an algorithm of admission to study at the Russian State University of Justice for foreign citizens under the quota of the Government of the Russian Federation. 🎓#StudentLife - in this section we share impressions and tips about student life. 📖#HistoricalInformation - learn interesting facts about the history of Russia. 🎉#RussianHolidays - you'll get an idea of Russian holidays and important traditions. 🗣️#RussianLanguage - this section will immerse you in the peculiarities of the Russian language and give you tips on how to learn it. Follow new posts, take part in discussions and feel free to ask questions! We are here to help you😊! Thank you for joining us! ❤️