Если запустить 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
🌍 In 2023, explorers finished mapping over 75% of the world’s seafloor in high detail, uncovering thousands of undersea mountains and canyons hidden beneath the oceans. ✨
#exploration⚡#mapping⚡#discovery⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Over 80% of Earth’s ocean remains unmapped and unexplored by humans. Modern sonar and robotic submersibles are revealing new mountains, trenches, and species with every deep-sea journey. ✨
#exploration⚡#ocean⚡#discovery⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The first map to show the Americas as a separate continent was made by German cartographer Martin Waldseemüller in 1507. It’s where the name “America” first appeared on a world map. ✨
#cartography⚡#history⚡#discovery⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 In 2022, explorers used sonar to map a hidden undersea volcano off Madagascar’s coast, revealing a peak 800 meters tall that was completely unknown before their expedition. ✨
#exploration⚡#discovery⚡#oceans⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌎 While mapping the ocean floor in 1947, researchers aboard HMS Challenger discovered the Mid-Atlantic Ridge, revealing Earth's largest mountain range hidden underwater. This seismic finding triggered the theory of plate tectonics—explaining how continents drift. The ridge stretches for over 16,000 kilometers beneath the Atlantic Ocean. ✨
#discovery⚡#geology⚡#oceanography
👉subscribe Interesting Planet
👉more Channels