@teslacn · Post #964 · 30.03.2022 г., 14:23
标续 #ModelY 单电机版又有新公示 5.6秒加速短期回归无望 💭群组📮投稿🏷#ModelY
Hashtags
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
Пребарај: #modely
@teslacn · Post #964 · 30.03.2022 г., 14:23
标续 #ModelY 单电机版又有新公示 5.6秒加速短期回归无望 💭群组📮投稿🏷#ModelY
Hashtags
@teslacn · Post #781 · 23.02.2022 г., 13:39
Tesla Greater China (Twitter) Traveling through the gap of sunset, wish this romantic moment remain always. #ModelY📸: K1說
Hashtags
@teslacn · Post #728 · 09.02.2022 г., 05:35
Tesla Greater China (Twitter) The best time is on the road, all the way to the sun🌞. #modely 📸: 吃不胖的胖小雷
Hashtags
@teslacn · Post #702 · 25.01.2022 г., 03:21
Tesla Greater China (Twitter) Not just a pet, also a sweet friend 🐕. #ModelY
Hashtags
@teslacn · Post #546 · 21.12.2021 г., 15:56
Tesla Greater China (Twitter) A tribute to nature with pure green energy. 用纯绿色的能量向大自然致敬。 #ModelY Cr.📷 春森同学在路上
Hashtags
@revheadcrypto · Post #410 · 30.08.2024 г., 16:41
🚗✨Tesla Model Y Facelift Coming in 2025!🌟 Exciting news for Tesla fans! The refreshed Model Y is set to hit the market, with deliveries starting as early as Q1. By the end of the year, a new three-row seating version will roll off the Shanghai assembly line, ready to take on Europe and beyond! 🌍🛠️ Get ready for an upgraded driving experience! 🎉 #Tesla#ModelY#Facelift2025#ElectricVehicles#Innovation#Auto🚀🔋