Skip to content

📝 Clarify guidance on using async def without await #13642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

swastikpradhan1999
Copy link

Summary

This PR improves the clarity of the "Concurrency and async/await" section in the documentation.

The original sentence: "If your application (somehow) doesn't have to communicate with anything else and wait for it to respond, use async def."

has been updated to:

"If your application doesn't need to communicate with anything else or await a response, it's still safe to use async def -- even if there's nothing to await."

Why this change?

The original phrasing could be misinterpreted as recommending async def even when it’s not useful. The new wording keeps the reassuring tone but clarifies that using async def without await is safe — not required.

Notes

  • This update aims to reduce confusion, especially for developers new to asynchronous programming in Python.
  • No functional or structural changes were made to the documentation layout.

@github-actions github-actions bot added the docs Documentation about how to use FastAPI label Apr 23, 2025
Copy link
Contributor

📝 Docs preview for commit 162fc49 at: https://d7ea1276.fastapitiangolo.pages.dev

Modified Pages

@svlandeg svlandeg changed the title Clarify guidance on using async def without await in async docs 📝 Clarify guidance on using async def without await Apr 28, 2025
Copy link
Member

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation about how to use FastAPI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy