@googlefactss · Post #40935 · 15.04.2026 г., 16:32
Emoji” is derived from three Japanese words: “e” for picture, “mo” for write, “ji” for character. @googlefactss#funfact
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
Пребарај: #funfact
@googlefactss · Post #40935 · 15.04.2026 г., 16:32
Emoji” is derived from three Japanese words: “e” for picture, “mo” for write, “ji” for character. @googlefactss#funfact
Hashtags
@googlefactss · Post #39971 · 29.10.2025 г., 06:07
More than 2,000 years ago Persians used yakhchals — ancient desert "refrigerators" — to make sorbet-like desserts and store ice. [read more here] @googlefactss#funfact
Hashtags
@googlefactss · Post #39955 · 27.10.2025 г., 07:15
The word “canvas” is related to the word “cannabis.” Historically, canvases were made of hemp. @googlefactss#funfact
Hashtags
@googlefactss · Post #39950 · 26.10.2025 г., 05:39
Getting dumped often leads to “frustration attraction,” which causes an individual to love the one who dumped him or her even more. @googlefactss#funfact
Hashtags
@googlefactss · Post #39947 · 25.10.2025 г., 11:09
Human mucophagy (literally "mucus feeding") is the act of eating one's own "boogers." @googlefactss#funfact
Hashtags
@googlefactss · Post #39937 · 20.10.2025 г., 17:17
Cats don’t have sweat glands over their bodies like humans do. Instead, they sweat only through their paws. @googlefactss#funfact
Hashtags
@googlefactss · Post #39936 · 19.10.2025 г., 15:24
The word "work" is from the Proto-Indo-European word *werg, meaning "to do." @googlefactss#funfact
Hashtags
@googlefactss · Post #39935 · 18.10.2025 г., 11:41
The Greek name for the mosquito is "anopheles," which means “good for nothing @googlefactss#funfact
Hashtags
@googlefactss · Post #39934 · 18.10.2025 г., 10:14
The chess term “checkmate” is from a 14th-century Persian phrase, “shah mat," meaning “the king is helpless. @googlefactss#funfact
Hashtags
@googlefactss · Post #39932 · 17.10.2025 г., 19:29
Each leopard's spot pattern is unique, like a human fingerprint, allowing individual leopards to be identified. @googlefactss#funfact
Hashtags
@googlefactss · Post #39931 · 16.10.2025 г., 07:46
A pangram is a sentence that contains every letter in the language. For example, "The quick brown fox jumps over the lazy dog." @googlefactss#funfact
Hashtags
@googlefactss · Post #39930 · 16.10.2025 г., 07:11
If you wrote out all the numbers (e.g. one, two, three . . . ), you would not use the letter "b" until the word "billion." @googlefactss#funfact
Hashtags