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

Резултати

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

Пребарај: #city

当前筛选 #city清除筛选
Pro Analysis

@proanalysistrader · Post #28555 · 18.03.2025 г., 08:15

#CITY/USDT analysis : #CITY has broken out and retested the 200 Exponential Moving Average (EMA). It is currently consolidating above the 200 EMA. The price is expected to bounce back from this level and resume its upward momentum to test higher levels. TF : 1H Entry : $1.107 Target : $1.160 SL : $1.075

Hashtags

Pro Analysis

@proanalysistrader · Post #28501 · 26.02.2025 г., 11:50

#CITY/USDT analysis : #CITY is currently in a downtrend, establishing new lows. The price is anticipated to retest the resistance zone before potentially reversing from there to resume bearish momentum and test lower levels. TF : 4h Entry : $1.220 Target : $1.083 SL : $1.300

Hashtags

Pro Analysis

@proanalysistrader · Post #28384 · 12.01.2025 г., 11:29

#CITY/USDT analysis : #CITY has broken below the support levels, forming lower lows (LLs) and lower highs (LHs) while trading below the 200 EMA. The price is expected to maintain its bearish momentum and test lower levels. TF : 2H Entry : $1.826 Target : $1.715 SL : $1.903

Hashtags

Pro Analysis

@proanalysistrader · Post #27908 · 06.09.2024 г., 14:16

#CITY/USDT analysis : #CITY is presently in a downtrend, trading below the 200 EMA. The price is currently consolidating above support levels. It is expected to be breached by the price soon and will continue its bearish momentum on lower time frames to test previous lows. Wait for a break of the $1.945 level to initiate a short position. TF : 1H Entry : $1.945 Target : $1.853 SL : $2.005

Hashtags

123•••10•••1314
ПретходнаСтраница 1 од 14Следна