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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #402 · 22 дек.

Отдельно разберём TaskGroup, который пришел на замену gather в Python 3.11. Ключевые отличия ▫️create_task() возвращает объект asyncio.Task, у которого есть соответствюущие методы управления. То есть у нас больше контроля ▫️это контекстный менеджер, который гарантирует что все таски будут остановлены по выходу из контекста ▫️ошибка автоматически отменяет незавершенные задачи, ▫️except* передает нам ExceptionGroup, в котором каждую ошибку можно обработать отдельно import asyncio import random async def do_it() -> str: if random.random() < 0.1: raise ValueError('Oops') delay = random.uniform(0.5, 1.5) await asyncio.sleep(delay) return delay async def main(): try: async with asyncio.TaskGroup() as tg: for _ in range(10): tasks.append(tg.create_task(do_it())) for t in tasks: print(t.result()) except *ValueError as e: for err in e.exceptions: print(err) asyncio.run(main()) Рекомендую изучить страницу Coroutines and Tasks из документации, где представлено больше интересных примеров и механизмов - таймауты - отмена задач - создание задач из другого потока #async

Hashtags

Резултати

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

Пребарај: #сb

当前筛选 #сb清除筛选
NIDO Russia (НИДО)

@nido_russia · Post #1715 · 18.07.2024 г., 04:50

⚠🇷🇺🏦 From July 25, your financial transaction in Russia may be blocked and refunds may be issued without your consent if it falls under the following categories: 📌 If It is made to an account in the bank's database for fraudulent transactions. It may be the sending or receiving bank's database. 📌 If there is information about the initiation of a criminal case from a client or other interested party 📌 If data is received from third-party organizations indicating a fraudulent transaction (for example, information from a telecom operator about unusual telephone activity for the client before the transfer of funds or an increase in the number of incoming messages from new numbers, including in instant messengers). Please note "including instant messengers") On the same day, an order will also come into effect, according to which banks will have to return money, including those voluntarily transferred to fraudsters, to clients within 30 days of their request. There are three grounds for this refund: 1. If the account to which the funds were transferred is in the fraudulent database; 2. If the bank did not notify the client about the transfer without his consent; 3. If the card was lost or used without the client's consent. In the latter case, the client must notify the bank about the loss, otherwise the bank has the right not to return the funds. Subscribe:@nido_russia https://t.me/nido_russia/1715 #news#Russia#finance#fraud#crime#centralbank#цб#сb