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 слични објави

Пребарај: #andreigrachev

当前筛选 #andreigrachev清除筛选
Crypto M - Crypto News

@CryptoM · Post #65181 · 11.04.2026 г., 16:54

🚀 Market Conditions Present Opportunities for Strategic Investments, Says DWF Labs Co-Founder The cryptocurrency market is currently experiencing a "very boring" phase, according to ChainCatcher. DWF Labs Co-Founder Andrei Grachev expressed on social media that while participants may engage in discussions or humor, significant activities such as financing, trading, investing, and business expansion are quietly underway. Grachev noted that the current market environment poses challenges for major projects, exchanges, and companies to make new listings or significant announcements, as high-profile actions may not be effective at this time. He advised maintaining patience in investment portfolios and waiting for more opportune moments. He emphasized that the market is not in decline but rather offers opportunities for seemingly mundane activities, such as buying and holding Bitcoin long-term or engaging in altcoin speculation. Grachev concluded that there is still much to do for builders and investors, while smaller investors should focus on learning, avoid lamenting losses, and enjoy the market they have chosen to enter. #cryptocurrency#marketconditions#investmentopportunities#DWF Labs #AndreiGrachev#bitcoin#altcoin#longtermholding#speculation#investors#builders#patience#learning#BTC