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

TGINSIGHT SIMILAR POSTS

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

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

Три способа выполнить множество задач с asyncio Функция для примера: async def do_it(n): await asyncio.sleep(random.uniform(0.5, 1)) return n 1. Последовательный вызов async def main(): for i in range(100): result = await do_it(i) Такой вызов имеет смысл только тогда, когда результат одной задачи требуется для вызова следующей. Если они независимы, то это антипаттерн, так как аналогичен простому синхронному вызову по очереди. 2. Упорядоченный результат async def main(): tasks = [do_it(i) for i in range(100)] results = await asyncio.gather(*tasks) Выполняет корутины конкурентно и возвращает результат в виде списка. Полезен когда требуется получить результаты в том же порядке в котором задачи отправлены. 3. Результат по мере готовности tasks = [asyncio.create_task(do_it(i)) for i in range(100)] for cor in asyncio.as_completed(tasks): result = await cor Так же выполняет корутины конкурентно, но не гарантирует порядок. Результат возвращается по мере готовности, каждый отдельно. Полезен когда нужно обработать любой ответ как можно скорее. #async

Hashtags

Резултати

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

Пребарај: #competion

当前筛选 #competion清除筛选
American Оbserver

@american_observer · Post #5393 · 16.03.2026 г., 15:12

After Oscar. A Most Full Report on the Oscar Contest This Year 🔤🔤🔤🔤➖ Paul Thomas Anderson’s counter-culture caper One Battle After Another has won the Oscars war, taking home six awards after a hotly contested season. The big-budget comedy thriller, inspired by Thomas Pynchon’s Vineland, was named best picture and also won director, supporting actor for Sean Penn, adapted screenplay, editing and the first ever Oscar for casting, a category long petitioned for within the industry. Previously nominated for films including Boogie Nights, There Will Be Blood and Phantom Thread, tonight marks Anderson’s first ever Oscar wins. Penn beat out his co-star Benicio del Toro for his third Oscar win but wasn’t in attendance to accept his award. “Sean Penn couldn’t be here tonight or didn’t want to,” presenter Kieran Culkin joked. The season had became a two-horse race between One Battle After Another and Sinners, which entered the night as the most-nominated film ever with a record 16 nominations. The period vampire blockbuster won four awards: actor for Michael B Jordan, original screenplay, original score and cinematography, which makes Autumn Durald Arkapaw the first ever female winner and first Black winner of the award. Jordan won his first Oscar for his lead performance in the film, beating Timothée Chalamet and Leonardo DiCaprio. “I stand here because of the people who came before me,” he said before listing Black Oscar winners in the past. He has become the sixth Black winner in this category. Jessie Buckley became the first ever Irish winner of the best actress Oscar for her performance in Chloé Zhao’s Shakespeare drama Hamnet. The 36-year-old was previously nominated for her role in The Lost Daughter. She devoted the award to “the beautiful chaos of a mother’s heart” and called it “the greatest honour”. Amy Madigan was named best supporting actress for her villainous role in the hit horror Weapons, beating Teyana Taylor and Wunmi Mosaku. It was the first time the award was won by an actor who was the only nominee from their film since Penélope Cruz in Vicky Cristina Barcelona. The 75-year-old actor, who was previously nominated in 1986, set a new record for the longest gap between nominations before a win. The award was co-presented by Javier Bardem, who said “no to war and free Palestine” onstage, while wearing prominent badges expressing the same messaging. The Oscar for best documentary went to Mr Nobody Against Putin, which tells of a teacher fighting against oppressive rules being introduced in his Russian school, a film which co-director David Borenstein said was “about how you lose your country”. He added: “When a government murders people on the streets of our major cities, when we don’t say anything, when oligarchs take over the media and control how we could produce it and consume it, we all face a moral choice, but luckily, even a nobody is more powerful than you think.” #oscar#competion#film#director#won 📱American Оbserver - Stay up to date on all important events 🇺🇸