Skip to content

Conversation

@dbrattli
Copy link
Collaborator

@dbrattli dbrattli commented Dec 9, 2025

Why

Python frameworks like FastAPI require actual async def functions to properly handle async I/O. Previously, Fable generated regular def functions returning Awaitable[T], which prevented FastAPI from detecting async endpoints.

How

  • F# task { } expressions now transpile to Python async def functions instead of regular functions returning Awaitable[T]
  • Return type is unwrapped from Task[T] to T for async functions (Python requires this)
  • Return statements are automatically wrapped with await

@dbrattli dbrattli merged commit bdf38d1 into main Dec 9, 2025
41 of 43 checks passed
@dbrattli dbrattli deleted the python-task-improvement branch December 9, 2025 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants