Skip to content
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

Features Request: Remove Python 2 support and add Async #3363

Closed
timkofu opened this issue Sep 16, 2019 · 5 comments
Closed

Features Request: Remove Python 2 support and add Async #3363

timkofu opened this issue Sep 16, 2019 · 5 comments

Comments

@timkofu
Copy link

timkofu commented Sep 16, 2019

The first one is to fully leverage Py3 features. Also, Py2 EOL is due in a few months.
The second one is to add speed. Much speed. So Flask can handle more requests with the same hardware, and run smoother while doing so.

Maybe both of these are already in the works?

@ThiefMaster
Copy link
Member

I think we can close this in favor of pallets/werkzeug#1322, as async features would not make much sense in Flask without having proper async support in Werkzeug.

The second one is to add speed. Much speed. So Flask can handle more requests with the same hardware, and run smoother while doing so.

Non-async apps are not necessarily slower.

And while I think that dropping Python 2 at some point makes sense, this should not be before the Python 2 EOL - and if there are no issues supporting both I personally would even wait a bit longer with removing Python 2 support, since there WILL be many bigger applications that need some more time to be adapted to Python 3 (and many linux distros still support Python 2 for a while).

@davidism
Copy link
Member

Regardless of when we drop Python 2 support, we don't proactively modify code to use newer patterns in most cases. Nothing in particular would change about Flask's code by dropping Python 2.

"asyncio is faster than traditional workers" is a falacy, the phrase is "asyncio enables a different paradigm to program in, but does not inherently make complex applications faster". We do plan to support ASGI (pallets/werkzeug#1322), but don't expect that to make your application faster. This is true for any application, not just Flask.

@techouse
Copy link

@timkofu Check out Quart if you want an Asyncio version of Flask.

@timkofu
Copy link
Author

timkofu commented Sep 17, 2019

@techouse Thanks.

@AlliedToasters
Copy link

We migrated our flask endpoints to fastAPI pretty smoothly, worth checking out in addition to Quart.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants