Українська
Відкрити в Telegram
PPython Talk

Python Talk

@python_talk · група · Технології · в індексі з 04.07.2026
58учасників
37 339повідомлень в індексі
O
"Friendship ended with Zig, now Rust is my best friend"
  1. A
    Browsing LinkedIn this weekend is gonna be even more painful.. "AI rewrote an entire framework from Zig to Rust. This is why coding is outdated..." 🫩
Уся гілка · 2 відповіді →
G
Hey, i got a sync function that i want to call asyncronously in a loop def api_call() ... # Do api call for chunk in batched(parse_csv(local_path), BATCH_LIMIT): # Do 10 api calls in parallel using async I tried with different things but couldn't get anything working. How do you do it?
  1. C
    Don't do it. Running a synchronous function in async context breaks your loop in a way that the other concurrent functions won't run until you're done. This is likely what you have experienced when trying to make it work. Run the code in a different thread, that puts it outside of the context of the asynchronous loop. Try asyncio.to_thread and asyncio.gather.
    1. A
      I think the question is more like, I have a sync function, how do I parallel-ize it such that I can handle it like an async function without doing the threads etc. stuff myself.
      1. C
        asyncio.to_thread is the abstraction. The answer only changes if the synchronous function is developer-owned and can be converted to a native asynchronous function. Unless of course there's an option to just pick an asynchronous library (assuming the synchronous function comes from a library) to replace the synchronous function.
Уся гілка · 6 відповідей →
G
can i do? with asyncio.TaskGroup() as tg: tg.create_task(asyncio.to_thread(call_api()))
  1. C
    Because the library is synchronous. If you can't replace your library with an asynchronous library, asyncio.to_thread is the answer.
Уся гілка · 2 відповіді →
Архів за місяцями
липень 2026червень 2026травень 2026квітень 2026березень 2026лютий 2026січень 2026грудень 2025листопад 2025жовтень 2025вересень 2025серпень 2025липень 2025червень 2025травень 2025квітень 2025березень 2025лютий 2025січень 2025грудень 2024листопад 2024жовтень 2024вересень 2024серпень 2024липень 2024червень 2024травень 2024квітень 2024березень 2024лютий 2024січень 2024грудень 2023листопад 2023жовтень 2023вересень 2023серпень 2023липень 2023червень 2023травень 2023квітень 2023березень 2023лютий 2023січень 2023грудень 2022листопад 2022жовтень 2022вересень 2022серпень 2022липень 2022червень 2022травень 2022квітень 2022березень 2022лютий 2022січень 2022грудень 2021листопад 2021жовтень 2021вересень 2021серпень 2021липень 2021червень 2021травень 2021квітень 2021березень 2021лютий 2021січень 2021грудень 2020листопад 2020жовтень 2020вересень 2020серпень 2020липень 2020червень 2020травень 2020квітень 2020березень 2020лютий 2020січень 2020грудень 2019листопад 2019жовтень 2019вересень 2019серпень 2019липень 2019червень 2019травень 2019квітень 2019березень 2019лютий 2019січень 2019грудень 2018листопад 2018жовтень 2018вересень 2018

Відкрита публічна стрічка з пошукового індексу ChatCrawler — «Google по публічному Telegram»; оновлюється в міру обходу майданчика. Час — UTC.

Лише публічний контент, офіційний API Telegram. Про проєкт · Питання · Межі індексу · Прибрати сторінку з видачі · Каталог · Пошук · Як ми рахуємо