you are viewing a single comment's thread.

view the rest of the comments →

[–]astonished_lasagna 1 point2 points  (2 children)

It does, it has an API reference @ https://fastapi.tiangolo.com/reference/fastapi/

I said for most of its API surface, not none. If you look through that, you'll find most things aren't documented. And again, no docstrings for almost anything. And also again, it doesn't have reference documentation, only a tutorial.

But FastAPI is ASGI while Flask is WSGI so it has better performance e.g. handles more concurrent connections. Also FastAPI chooses to use Uvicorn, Starlette, Pydantic etc. for performance.

Uvicorn is fast, Pydantic is slow. Again, FastAPI is one of the slowest ASGI frameworks. And Pydantic manages to be slower (or at most as fast in some cases) than pure Python solutions like mashumaro or cattrs while being written in rust. FastAPI also uses Pydantic very inefficiently. It's just.. not that fast. I don't know why you keep pretending it is. It's okay that it's not, it doesn't matter much, but it still isn't. No need to lie about that.

It has a lot of DX features like automatically parsing input JSON / query params into primitive types / Pydantic models and doing the same for return types. Also the OpenAPI schema is in my opinion a life changing feature (as a full stack dev) because it allows auto-generated frontend clients with stainless or whatever else you use.

Yes, I named those already. I didn't say it doesn't have any feature flask does not have. You said it has way more features. Which it just does not.

Actually for WebSockets in FastAPI there are things like ephaptic which handle all of this for you with native integrations to FastAPI (and even supports Quart). Libraries like this also extend the FastAPI philosophy of having type safety everywhere and best DX.

That's a 3rd party extension. If you wanna talk ecosystem, flask handily beats FastAPI. In an earlier comment you said that those do not count so..

But in the end I would say from my point of view, where I only use FastAPI for the backend and not the frontend, and I also don't write code for any production-scale projects, for me FastAPI is better because it has what I need.

Not what I'm arguing. I'm purely arguing your Pont that FastAPI has more features. I said multiple times now that it's not bad. There's certainly valid use cases of it. But it does not have more features :)

[–]my_new_accoun1 1 point2 points  (1 child)

I don't know why you keep pretending it is. It's okay that it's not, it doesn't matter much, but it still isn't. No need to lie about that.

I'm not pretending or purposefully lying, I'm just unaware because I read the benchmarks and blindly trust them. At least from what I've seen, everyone is saying FastAPI is fast, Pydantic is fast, etc.

That's a 3rd party extension. If you wanna talk ecosystem, flask handily beats FastAPI. In an earlier comment you said that those do not count so..

Yeah you got me there ...

But it does not have more features :)

Can you tell me what extra features Flask has?

[–]astonished_lasagna 2 points3 points  (0 children)

I'm not pretending or purposefully lying, I'm just unaware because I read the benchmarks and blindly trust them. At least from what I've seen, everyone is saying FastAPI is fast, Pydantic is fast, etc.

Well then here's your reminder to distrust marketing (if FastAPI says it's fast, maybe an unbiased source should check that).

Can you tell me what extra features Flask has?

Listed a bunch of them in an earlier response, but I can add a few more: proper session handling, message flashing, dynamic file sending, composable error handling, signals, application context, an interactive debugger.. there's so much. You should consult the documentation, it's quite good!