Стандартная библиотека asyncio это стандарт (начиная с Py3.4) для работы с асинхронным кодом. Но эта библиотека достаточно низкоуровневая, со своими проблемами, устаревшими подходами.
Чтобы исправить это, были созданы разные обертки и альтернативы с реализацией популярных инструментов и паттернов асинхронного программирования. Это такие библиотеки как:
- trio: улучшает корректность выполнения, не оставляя потерянных корутин при ошибках, то есть предлагает Structured Concurrency из коробки.
- curio: упрощение синтаксиса и читаемости кода, больше похоже на работу с потоками.
- anyio: универсальная обертка над asyncio или trio плюс множество вспомогательных инструментов.
anyio используется в FastAPI как основная библиотека для работы с асинхронным кодом и вызовом синхронного кода из асинхронного.
В общем, рекомендую почитать про возможности anyio, возможно вы более не будете использовать чистый asyncio в своих проектах)
Это совсем не значит что дефолтный asyncio плох, он тоже даёт достаточный для работы функционал и продолжает развиваться. Например, в версии 3.11 появились TaskGroup, с похожим на trio функционалом. Так что он тоже актуален, просто придется больше написать кода самостоятельно.
#libs#async
🇺🇸New York Proposes Restrictions on AI Chatbots to Protect Children Online
New York Governor Kathy Hochul unveiled State of the State proposals aimed at protecting children from online harms, including predators, scams, and harmful AI chatbots integrated into digital platforms. The legislative package targets social media and online gaming services and explicitly includes disabling certain AI chatbot features for minors. The initiative is framed as part of a broader response to the youth mental health crisis.
The proposals would expand age verification requirements across platforms, mandate “privacy by default” settings for children, restrict unsolicited contact and location sharing, and require parental approval for connections for users under 13. Parents would also gain controls over children’s financial transactions. These measures build on prior New York actions, including bans on smartphones in schools, social media warning labels, restrictions on addictive feeds, and safeguards against AI companions.
In parallel, the Governor proposed a statewide expansion of Teen Mental Health First Aid training, with the goal of enabling every tenth grader to receive training. The initiative complements the expansion of school-based mental health clinics and peer support programs, positioning New York as a leading U.S. jurisdiction linking AI governance, platform regulation, and youth mental health policy.
#AIRegulation#ChildSafety#AIChatbots
Stanford Research Raises Concerns aboutChatbots Use in Legal Field
Greetings everyone! Stanford University's latest research unveils unsettling truths about popular AI chatbots, including OpenAI's ChatGPT and Google's PaLM 2. When faced with legal questions, these widely-used models exhibited "hallucinations" in responses a staggering 75% of the time.
The implications are particularly worrisome for self-represented litigants who rely on these AI tools due to financial constraints. As hopes for AI aiding legal services soar, the study underscores the urgent need for refining these models to ensure accurate and reliable legal assistance
#AILaw#LegalTech#AIChatbots#LegalServices#StanfordResearch
UK Passes Online Safety Bill - AI Chatbots Included
Hello, dear subscribers! The UK's Online Safety Bill, designed to regulate online platforms and protect users, has received approval from the House of Lords, taking it one step closer to becoming law.
This comprehensive 300-page legislation addresses various aspects, from combating the spread of illegal content online to safeguarding social media users from online harassment. Notably, now it introduces provisions concerning AI chatbots like ChatGPT and aims to protect users from harmful content.
#OnlineSafetyBill#AIChatbots#Deepfake#UKRegulation#OnlineSafety
😈Yandere AI maid to fulfill your fantasies. 😈
📲Download and play: http://openlove.life
#AIgirlfriend#roomescape#aigame#aichatbots#neko#catgirl#maid#女仆装