lingo.lol is one of the many independent Mastodon servers you can use to participate in the fediverse.
A place for linguists, philologists, and other lovers of languages.

Server stats:

69
active users

#asyncio

0 posts0 participants0 posts today
The Polish Dispatch<p>I need some obscure python help, fellow mastodonians:</p><p>I have a nested async function inside a regular function.</p><p>I need to test whether to await on it inside a decorator, but neither of `inspect` or `asyncio` helpers work, and .__code__.co_flags do not indicate it being a coroutine/awaitable/...</p><p>Right now I've added a flag to my decorator to manually control wrapped function behavior, but it's just a workaround.</p><p>Any tips? Thanks.</p><p><a href="https://mstdn.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://mstdn.social/tags/asyncio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>asyncio</span></a> <a href="https://mstdn.social/tags/coroutine" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>coroutine</span></a> <a href="https://mstdn.social/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> <a href="https://mstdn.social/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://mstdn.social/tags/fedihelp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>fedihelp</span></a></p>
NEO//LIX 🔊<p>Debugging <a href="https://soc.psynet.me/tags/asyncio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>asyncio</span></a> stuff in <a href="https://soc.psynet.me/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> is a pain in the arse. &gt;_&lt; Is there really no way to find out where the coroutine in which my exception is raised has been called? The stack trace is completely useless.</p><p>Edit: Turns out the error happened in a completely different place than I’d expected, which explains the trace. 🤦‍♂️ Blindly debugging projects without remotely understanding how they work rocks. 😬</p>
Pete Keen<p>So, I find myself with a silly software stack to do something incredibly basic. </p><p>I have:<br>- Klipper firmware on a Raspberry Pi Pico<br>- Klipper host-side with custom extension<br>- Moonraker<br>- ESPHome emulation layer<br>- Home Assistant</p><p>All to animate some addressable RGBW LEDs.</p><p>Maybe I can bypass Moonraker........</p><p> <a href="https://hachyderm.io/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://hachyderm.io/tags/asyncio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>asyncio</span></a> <a href="https://hachyderm.io/tags/klipper" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>klipper</span></a></p>
Pete Keen<p>I went through the exercise of making a very basic pure <a href="https://hachyderm.io/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://hachyderm.io/tags/asyncio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>asyncio</span></a> <a href="https://hachyderm.io/tags/klipper" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>klipper</span></a> mcu protocol client.</p><p>Then I found myself contemplating board setup and ... this isn't actually better than just running klippy. Yes it's an old fashioned hand rolled reactor rather than something shiny like AnyIO but it's fine. Clearly it works.</p>
:rss: Hacker News<p>How Python Asyncio Works: Recreating It from Scratch<br><a href="https://jacobpadilla.com/articles/recreating-asyncio" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">jacobpadilla.com/articles/recr</span><span class="invisible">eating-asyncio</span></a><br><a href="https://rss-mstdn.studiofreesia.com/tags/ycombinator" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ycombinator</span></a> <a href="https://rss-mstdn.studiofreesia.com/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> <a href="https://rss-mstdn.studiofreesia.com/tags/Asyncio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Asyncio</span></a> <a href="https://rss-mstdn.studiofreesia.com/tags/Generators" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Generators</span></a> <a href="https://rss-mstdn.studiofreesia.com/tags/await" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>await</span></a> <a href="https://rss-mstdn.studiofreesia.com/tags/Async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Async</span></a></p>
Matthew Martin<p><a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://mastodon.social/tags/asyncio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>asyncio</span></a> Is this right, all decorators have to also be async? So I'll end up with up to 2 versions of very function and 2 versions of every decorator (or have to do functional programming magic to convert one to the other)?</p><p><a href="https://stackoverflow.com/a/77604618/33264" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">stackoverflow.com/a/77604618/3</span><span class="invisible">3264</span></a></p>
Matthew Martin<p>Should I add the `async` keyword to my API methods that call opensearch, redis, postgres, &amp; other microservices?</p><p>context:<br><a href="https://mastodon.social/tags/connexion" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>connexion</span></a> + <a href="https://mastodon.social/tags/starlette" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>starlette</span></a> + <a href="https://mastodon.social/tags/uvicorn" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>uvicorn</span></a> + <a href="https://mastodon.social/tags/gunicorn" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>gunicorn</span></a> + supervisord, <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> 3.12</p><p><a href="https://mastodon.social/tags/asyncio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>asyncio</span></a></p>
Matthew Martin<p>Reading some old news before I add the async keyword before my API controllers</p><p>**point**: <a href="https://mastodon.social/tags/asyncio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>asyncio</span></a> is slow <br><a href="https://calpaterson.com/async-python-is-not-faster.html" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">calpaterson.com/async-python-i</span><span class="invisible">s-not-faster.html</span></a></p><p>**counterpoint**: well yeah, if you do it wrong. <br><a href="https://blog.miguelgrinberg.com/post/ignore-all-web-performance-benchmarks-including-this-one" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">blog.miguelgrinberg.com/post/i</span><span class="invisible">gnore-all-web-performance-benchmarks-including-this-one</span></a></p><p><a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a></p>
Cadair<p>I am considering moving away from aiohttp in parfive (<a href="https://github.com/Cadair/parfive" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/Cadair/parfive</span><span class="invisible"></span></a>**) **as it's quite a heavyweight dependency and has some weird behaviour sometimes. httpx looks interesting as a potential async http client library, does anyone else have other suggestions of things I should investigate? <a href="https://mastodon.matrix.org/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://mastodon.matrix.org/tags/asyncio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>asyncio</span></a></p>
wobweger :verified:<p>after decades of coding <a href="https://mstdn.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> I still get impressed <br>how fast task are getting done.<br>today's gratitude goes also to<br><a href="https://mstdn.social/tags/pandas" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>pandas</span></a> <a href="https://mstdn.social/tags/asyncua" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>asyncua</span></a> <a href="https://mstdn.social/tags/asyncio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>asyncio</span></a> <a href="https://mstdn.social/tags/jupyterNotebooks" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>jupyterNotebooks</span></a> <a href="https://mstdn.social/tags/gitlab" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>gitlab</span></a> and <a href="https://mstdn.social/tags/vscode" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>vscode</span></a> <br>🥰</p>
Steffo :steffo:<p>Is there someone here who knows how to use the TimedScheduler in Python?</p><p>Edit: I got it with the help of a friend! aioscheduler doesn't work in Python 3.11...</p><p><a href="https://fellies.social/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://fellies.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://fellies.social/tags/asyncio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>asyncio</span></a></p>
robrich<p><a href="https://superfastpython.com/python-asyncio/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">superfastpython.com/python-asy</span><span class="invisible">ncio/</span></a> - the complete guide to <a href="https://hachyderm.io/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> &amp; <a href="https://hachyderm.io/tags/await" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>await</span></a> (the <a href="https://hachyderm.io/tags/AsyncIO" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>AsyncIO</span></a> library) in <a href="https://hachyderm.io/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a>. Great guide <a href="https://www.linkedin.com/in/jasonbrownlee/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="">linkedin.com/in/jasonbrownlee/</span><span class="invisible"></span></a>.</p>
Carlton Gibson 🇪🇺<p>&gt; My opinion is that asyncio does not meet any of these criteria.</p><p>The ever awesome Charles Leifer, offering some doubts on Python's choice of cooperative multitasking with asyncio. </p><p>Food for thought 🥪</p><p><a href="https://charlesleifer.com/blog/asyncio/" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">charlesleifer.com/blog/asyncio</span><span class="invisible">/</span></a> <a href="https://fosstodon.org/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://fosstodon.org/tags/asyncio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>asyncio</span></a></p>