Стандартная библиотека asyncio это стандарт (начиная с Py3.4) для работы с асинхронным кодом. Но эта библиотека достаточно низкоуровневая, со своими проблемами, устаревшими подходами.
Чтобы исправить это, были созданы разные обертки и альтернативы с реализацией популярных инструментов и паттернов асинхронного программирования. Это такие библиотеки как:
- trio: улучшает корректность выполнения, не оставляя потерянных корутин при ошибках, то есть предлагает Structured Concurrency из коробки.
- curio: упрощение синтаксиса и читаемости кода, больше похоже на работу с потоками.
- anyio: универсальная обертка над asyncio или trio плюс множество вспомогательных инструментов.
anyio используется в FastAPI как основная библиотека для работы с асинхронным кодом и вызовом синхронного кода из асинхронного.
В общем, рекомендую почитать про возможности anyio, возможно вы более не будете использовать чистый asyncio в своих проектах)
Это совсем не значит что дефолтный asyncio плох, он тоже даёт достаточный для работы функционал и продолжает развиваться. Например, в версии 3.11 появились TaskGroup, с похожим на trio функционалом. Так что он тоже актуален, просто придется больше написать кода самостоятельно.
#libs#async
💰Indonesia is preparing a tough law against corruption
📰 Indonesian President Prabowo Subianto supported the bill on confiscation of assets gained by criminal means. The new law will allow seizing assets from corrupt officials even if their origin is not proven in court.
➡️ This could be a breakthrough in the fight against embezzlement and return billions of rupiah to the budget.
ℹ️ The Asset Forfeiture Bill (RUU Perampasan Aset) has been under discussion for years. Support at the presidential level could be a decisive step to get the document passed.
#laws@BaliNews
🏝Bali continues to sweep the coastline of illegal buildings
👮♂️Balangan is next. The area risks repeating the fate of Bingin: the authorities have already counted 23 cafes, warung and surf school, built without permits.
🚧 Now the documents are being checked, and only after the decision of the regional parliament will heavy machinery be able to move from Bingin to this beach - tentatively not before the end of August.
#places#laws@BaliNews
🥳'Enough of your parties': Bali wants to ban partying in Bali
📰 Coordinating Minister for Maritime Affairs and Investment Luhut Binsar Panjaitan said he is concerned about the huge number of foreigners coming to Bali.
❌ The main issue the government wants to focus on is the same – respect from foreigners for the local culture and way of life. The minister has explicitly called for stricter party laws.
We also don't want villas to become party venues and people dancing virtually naked in clubs. We will not let them do that. Enough of your parties.
@BaliNews
#tourism#laws
🚯‘Bali doesn't need a rubbish tourist’: Balinese demand stricter controls on foreigners
Dozens of angry social media posts from outraged Balinese forced Indonesian Minister of Tourism and Creative Economy Sandiaga Uno to calm the public.
The minister reiterated the need to hold foreign visitors strictly accountable if they break the rules. This applies to tourists, investors and foreign business owners.
📞 The Directorate General of Immigration of the Ministry of Law and Human Rights has opened a hotline for people who want to report suspicious activities or legal status of foreign nationals. The head of the department, Saffar Muhammad Ghodam, said the alert line is operated by the information and complaints service for immigration monitoring and enforcement activities. Reporting any information, including unverified information, is encouraged to 📱 (+62)81399679966.
‘This immigration monitoring and enforcement hotline allows the public to lodge complaints against foreigners suspected of violating immigration rules,’
Saffar said in an official statement.
@BaliNews
#tourism#laws
👮 Bali has started spot check drug tests on tourism drivers
Bali has introduced spot-check drug tests on tourist drivers at top tourist attractions on the island.
The first spot checks were conducted on Friday, April 19th.
The spot checks are part of a wider mission to crack down on the use of drugs and tourist service providers driving and conducting work activities under the influence.
@BaliNews
#laws#tourism
It’s illegal to ride an ugly horse in Wilbur, Washington, USA. The law dates back to 1894 and could carry a hefty fine of up to $300.
@googlefactss#laws#usa
A man is forbidden to kiss a woman while she’s asleep in Logan County, Colorado USA, making a "Sleeping Beauty" scenario illegal, though it's more of a quirky local legend than actively enforced statute.
@googlefactss#laws#usa
📰Bali tightens measures against reckless tourists
Speeding will result in deportation.
👮♂️ The hunt for reckless drivers is underway in Bali: one serious speeding offense, riding without a helmet, or performing stunts on a motorcycle will now result in deportation without warning, rather than a fine.
📍 The police and immigration service are already conducting night raids in Chang and Uluwatu, confiscating motorcycles and checking riders.
It's time to clean up the island of people who don't respect others, but above all themselves...
#transport#laws@BaliNews
В РБК вышла моя колонка с критикой обсуждаемого законопроекта по регулированию почтовых сервисов [1].
Самые неприятные последствия что этого что других запретительных законов - это падение привлекательности российской юрисдикции для любых интернет проектов. При таком регулировании цифровой экономики не будет.
Ссылки:
[1] https://www.rbc.ru/opinions/politics/14/10/2019/5da033ea9a79478f25ca783c
#laws#runet
📱Indonesian authorities are preparing to block Telegram
📰 The country's Minister of Communications and Information Budi Aryeh Setiadi said that Telegram is one step away from being blocked on the territory of Indonesia. All because of its refusal to co-operate with law enforcement.
We have warned Telegram twice, because on this platform there is a mass distribution of not only gambling, but also pornography.
said Budi Aryeh Setiadi at the Jakarta Communications and Information Office.
🤞 However, the communications and information minister did not give an exact timeline for when Durov's messenger will be out of Indonesian laws. At the moment it is known about two letters that the Indonesian authorities sent to the Telegram office. In addition, an investigation is ongoing. And it is on its results, apparently, that the verdict that will be handed down to the messenger will depend.
@BaliNews
#accidents#laws
🕵🏼Mass capture of cybercrime suspects occurred in Bali
👮♂️ Indonesian authorities detained more than a hundred foreign nationals. This massive operation was carried out by the Bali Becik unit, which is the name of a special branch of immigration enforcers in charge of controlling foreigners who break the law. Part of the immigration team conducted surveillance at a villa in Marga neighborhood, Tabanan regency.
💻 The detainees had no official documents and they all had expired visas. In addition, numerous computers and cell phones were found at the scene, indicating likely cybercriminal activity.
@BaliNews
#accidents#laws
📰Yoga for donation is a direct route to deportation from Bali
ℹ️ A yoga and freediving trainer was deported from Bali after immigration saw announcements on his social media accounts of “yoga-for-donation” classes and deemed them illegal work. Officers found out that the foreigner only had a tourist visa, which does not authorize him to conduct commercial activities.
👮♂️ Bali tourists should remember: any work without authorization will cost the foreigner deportation and entry ban.
#laws#free@BaliNews