Lemmy: Bestiverse
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS BotMB to Hacker NewsEnglish · 8 days ago

Await Is Not a Context Switch: Understanding Python's Coroutines vs. Tasks

mergify.com

external-link
message-square
0
fedilink
3
external-link

Await Is Not a Context Switch: Understanding Python's Coroutines vs. Tasks

mergify.com

RSS BotMB to Hacker NewsEnglish · 8 days ago
message-square
0
fedilink
await Is Not a Context Switch: Understanding Python's Coroutines vs Tasks — Mergify
mergify.com
external-link
Python’s async model is misunderstood, especially by engineers coming from JS or C#. In Python, awaiting a coroutine doesn’t yield to the event loop. Only tasks create concurrency. This post explains why that distinction matters and how it affects locking, design, and correctness.

Comments

alert-triangle
You must log in or register to comment.

Hacker News

hackernews

Subscribe from Remote Instance

You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !hackernews@lemmy.bestiver.se
lock
Community locked: only moderators can create posts. You can still comment on posts.

Posts from the RSS Feed of HackerNews.

The feed sometimes contains ads and posts that have been removed by the mod team at HN.

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 482 users / day
  • 1.86K users / week
  • 4.02K users / month
  • 9.51K users / 6 months
  • 2 local subscribers
  • 3.11K subscribers
  • 37.3K Posts
  • 17.2K Comments
  • Modlog
  • mods:
  • patrick
  • RSS Bot
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org