> Sometimes applications need to store data during the lifetime of a request, so that it can be shared between the before or after request handlers and the route function. The request object provides the g attribute for that purpose.
`g` is short for "global", but it is global to that request only. This makes data available to hooks which can wrap request handlers before/after they execute
It's inspired by Flask's same functionality, though it's a part of the greater Application Context and Request Context in Flask, which Microdot apparently doesn't have:
Also may be of serious consideration to people looking at microdot, because:
* Pure asyncio only, zero dependencies.
* Ships its own ASGI server, like Sanic. (No juggling uvicorn and gunicorn dependencies).
* Tiny library, feels like Starlette from the glory days.
* streaming responses by default (return stuff, then do processing, return more stuff).
* handles streaming multipart form uploads / streaming downloads, without external dependencies.
* tons of safeguards built in (request/response size limits, bandwidth throttling!) No massive DoS exploit potential found in Starlette/Uvicorn/FastAPI lol.
* the intuitive Sanic-style @on_request + @on_response rather than the complex middleware system in Starlette nowadays
Only 2,500 lines, with IMHO, far more important features than Starlette/FastAPI already baked in.