Python: post #2263830 — TG.ME

Nandu Baruiowo what a magical idea you give me. so the important part i understand is that on case of fastapi, on each request from the web request only the SessionDep got executed is this the concept of Depends() of the fastapi and equivalent on the flask-di 's Depends()…
SessionDep is Session Dependancy for short. Its annotated type which resolves get_session() function on each request that needs the session (as stated in route definition)

Depends is something FastAPI uses to resolve those dependacies - and yes, di-flask works the same way

Start working on your projects and stop overthinking it.

If you want to learn how all this works internally, go read python source code 🤷‍♂
August 25, 2026