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

Резултати

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

Пребарај: #briar

当前筛选 #briar清除筛选
Libreware

@libreware · Post #980 · 24.09.2021 г., 15:11

Briar 1.3.8 release today https://briarproject.org/news/2021-briar-1.3-released/ Official Briar fdroid repository: https://briarproject.org/fdroid/repo/?fingerprint=1FB874BEE7276D28ECB2C9B06E8A122EC4BCB4008161436CE474C257CBF49BD6 #briar#im#p2p

Libreware

@libreware · Post #1143 · 26.05.2023 г., 13:59

6 Best Secure Messaging Alternatives to WhatsApp | Avoid the Hack – https://avoidthehack.com/best-secure-messengers The content of your messages and the metadata associated with them should be secure and private. Unfortunately many messengers out there fail to do this. Telegram operates in the cloud, and while this does have good portability across multiple devices and device types, the service provider (or anyone with access to the cloud server) could theoretically read them at any time with relative ease; Telegram stores messages on the third-party cloud provider's server. According to Telegram’s privacy policy, the service itself logs IP addresses and phone numbers. #Infosec#Session#SimpleXchat#Briar#Threema #Element#Telegram#privacy