TRICKY_PYTHON Telegram 101
Хороший пост про проблему, про которую довольно легко забыть. Если делать просто asyncio.create_task() не сохраняя ссылку на результат в переменную, то сборщик мусора может прибить задачу до того, как она будет исполнена и получится очень сложно отлавливаемый баг.

В документации это поведение отражено только с 3.9, хотя сама функция появилась в 3.7. Сейчас даже в примере хорошо показали "как правильно", тем не менее думаю многие и не помнят про такое поведение (я вот не помнил). Вот тут расписано подробнее https://textual.textualize.io/blog/2023/02/11/the-heisenbug-lurking-in-your-async-code/
👍18🔥8



tgoop.com/tricky_python/101
Create:
Last Update:

Хороший пост про проблему, про которую довольно легко забыть. Если делать просто asyncio.create_task() не сохраняя ссылку на результат в переменную, то сборщик мусора может прибить задачу до того, как она будет исполнена и получится очень сложно отлавливаемый баг.

В документации это поведение отражено только с 3.9, хотя сама функция появилась в 3.7. Сейчас даже в примере хорошо показали "как правильно", тем не менее думаю многие и не помнят про такое поведение (я вот не помнил). Вот тут расписано подробнее https://textual.textualize.io/blog/2023/02/11/the-heisenbug-lurking-in-your-async-code/

BY Хитрый Питон




Share with your friend now:
tgoop.com/tricky_python/101

View MORE
Open in Telegram


Telegram News

Date: |

Telegram is a leading cloud-based instant messages platform. It became popular in recent years for its privacy, speed, voice and video quality, and other unmatched features over its main competitor Whatsapp. Among the requests, the Brazilian electoral Court wanted to know if they could obtain data on the origins of malicious content posted on the platform. According to the TSE, this would enable the authorities to track false content and identify the user responsible for publishing it in the first place. Telegram has announced a number of measures aiming to tackle the spread of disinformation through its platform in Brazil. These features are part of an agreement between the platform and the country's authorities ahead of the elections in October. Just as the Bitcoin turmoil continues, crypto traders have taken to Telegram to voice their feelings. Crypto investors can reduce their anxiety about losses by joining the “Bear Market Screaming Therapy Group” on Telegram. Hui said the time period and nature of some offences “overlapped” and thus their prison terms could be served concurrently. The judge ordered Ng to be jailed for a total of six years and six months.
from us


Telegram Хитрый Питон
FROM American