@social_justice_watch · Post #17905 · 09.02.2023 г., 18:44
And this is one of the many reasons why self-identification is a thing. (Applicable to ADHDers as well.) #Autism#autistic#ActuallyAutistic#ADHD#AuDHDsource
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #401 · 15 дек.
Функция asyncio.wait() это еще один способ вызвать множество асинхронных задач. Она работает в нескольких режимах. 1. Самый простой - ждем завершения всех задач async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(10)] done, pending = await asyncio.wait( tasks, return_when=asyncio.ALL_COMPLETED ) for task in done: try: print(task.result()) except Exception as e: print(e) Очень похоже на gather, но работает не так. ▫️возвращает не результаты, а два сета с объектами Task у которых можно забрать результат через task.result() если они в списке done ▫️не гарантирует порядок результатов так как оба объекта это set ▫️не выбрасывает исключение когда оно появляется, а сохраняет его в Task. Исключение появится когда попробуете забрать резултьтат. 2. Ждем завершения первой задачи, даже если там ошибка. async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(3)] done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED ) # в done может быть несколько задач! for task in done: try: print(task.result()) except Exception as e: print(f"Fail: {e}") # Оставшиеся задачи в pending, как правило, нужно отменить, иначе они будут продолжать работать for task in pending: task.cancel() В сете done будут таски которые успели завершится, причем как успешно так и нет. 3. До первой ошибки. Тоже самое, но с аргументом FIRST_EXCEPTION done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_EXCEPTION ) Функция завершается как только первая задача упадет с ошибкой. Учтите, что в любом случае done вы можете обранужить несколько задач, как с ошибками так и успешные. ↗️ Полный листинг примеров здесь #async
Hashtags
Пребарај: #audhd
@social_justice_watch · Post #17905 · 09.02.2023 г., 18:44
And this is one of the many reasons why self-identification is a thing. (Applicable to ADHDers as well.) #Autism#autistic#ActuallyAutistic#ADHD#AuDHDsource
@social_justice_watch · Post #17968 · 07.03.2023 г., 22:50
Ableist stereotypes are bullshit. Also, we know our neurokin when we see them. 👀😉 #Autism#autistic#ActuallyAutistic#AuDHD#Neurodivergent#AutismAcceptancesource
@social_justice_watch · Post #17902 · 09.02.2023 г., 18:13
It’s like watching a slow-motion train wreck from the conductor’s seat. #Autism#Autistic#ActuallyAutistic#adhd#adhdtwitter#AuDHDsource
@social_justice_watch · Post #18069 · 18.05.2023 г., 00:28
I will always explain my jokes to you. 😘#autistic#ActuallyAutistic#AuDHD#ADHD#Neurodivergent#AutismAcceptancesource
@social_justice_watch · Post #17903 · 09.02.2023 г., 18:34
Facing judgment to provide accommodations can be hard. I see you, though, and maybe someone else does too. #Autism#autistic#ActuallyAutistic#ADHD#AuDHD#parentingstruggles#AutismAcceptancesource
@social_justice_watch · Post #18093 · 31.05.2023 г., 22:12
Alexithymia anyone? #Autism#autistic#ActuallyAutistic#audhd#ADHD#alexithymia #Emotionssource
@social_justice_watch · Post #17983 · 23.03.2023 г., 00:20
Trust me, I would LOVE for my kid’s struggles to be as much in my power to fix as schools seem to think they are. #parentblame#Autism#ADHD#AuDHD#pda#notfineinschool#schoolrefusalsource
@social_justice_watch · Post #18106 · 08.06.2023 г., 21:47
If it ain’t broke - let’s break it again and see what happens! #iep#504plan#ehcp#specialeducation#Autism#autistic#ADHD#AuDHDsource
@social_justice_watch · Post #17899 · 09.02.2023 г., 17:54
Go ahead and call me "anti-science' then. #Autism#autistic#ActuallyAutistic#ADHD#AuDHD#pda#aba#pbs#pbissource
@social_justice_watch · Post #18116 · 20.06.2023 г., 21:11
Pick your battles…but not this one. Put this one back. #Autism#autistic#actuallyautistic#ADHD#AuDHD#sensoryprocessing#SPD#arfid#neurodivergencesource