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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #422 · 30 мар.

Если запустить REPL с модулем asyncio, то вы входите в особый асинхронный REPL. user@host:~$ python -m asyncio asyncio REPL 3.12.7 ... Use "await" directly instead of "asyncio.run()". >>> import asyncio >>> В этом режиме - создаётся и настраивается event loop - уже импортирован asyncio - работает await на верхнем уровне То есть такая команда сработает без ошибок! await asyncio.sleep(3) Удобно для тестирования асинхронных функций без создания ивентлупов и остальной обвязки. Работает в: 3.8+ #tricks#async

Резултати

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

Пребарај: #generic

当前筛选 #generic清除筛选
djangoproject

@djangoproject · Post #267 · 23.02.2017 г., 13:44

https://www.python.org/dev/peps/pep-0443/ This PEP proposes a new mechanism in the #functools standard library module that provides a simple form of generic programming known as #single_dispatch#generic functions. A generic function is composed of multiple functions implementing the same operation for different types. Which implementation should be used during a call is determined by the #dispatch algorithm. When the implementation is chosen based on the type of a single argument, this is known as #single_dispatch . #overloading