from Hacker News

Flask 2.0.0 has been merged into master

by tpfour on 5/12/21, 12:13 AM with 53 comments

  • by chirau on 5/12/21, 12:33 AM

    In case anyone is interested in the major changes in 2.0.x:

    https://flask.palletsprojects.com/en/master/changes/

  • by nerdbaggy on 5/12/21, 12:47 AM

    I have moved most of my stuff to FastAPI. It’s so much more enjoyable than flask. https://fastapi.tiangolo.com/
  • by liquidise on 5/12/21, 12:57 AM

    > Drop support for Python 2

    Python 3 released on '08. Flask debuted a couple of years later in 2010, on Python 2. 11.5 years later Python 2 is nearly in the rearview. The history of the Python 3 release is surely an impressive one.

    On a more related note, props to devs/contributors for this release. My experience with Flask was pop-up projects and never mission critical, but i always found it a joy to use and quite intuitive.

  • by rastapasta42 on 5/12/21, 1:18 AM

    I am disappointed this release does not introduce any functionality similar to the Flask-Classful project.

    I find built-in MethodViews very limited and unable to capture context.

    Furthermore, MethodViews force you to artificially split endpoints between multiple classes when functionality better belongs in a single class.

    https://flask-classful.teracy.org/#using-custom-routes

  • by whalesalad on 5/12/21, 1:18 AM

    This is huge. (Serious!) https://github.com/pallets/flask/pull/3907

        Add route decorators for common HTTP methods. For example, 
        @app.post("/login") is a shortcut for 
        @app.route("/login", methods=["POST"]).
  • by lettergram on 5/12/21, 12:47 AM

    Honestly, I thought flask was mostly just in maintenance mode. Glad to see it progress!
  • by systemvoltage on 5/12/21, 5:27 AM

    > Add route decorators for common HTTP methods. For example, @app.post("/login") is a shortcut for @app.route("/login", methods=["POST"]). #3907

    Why? By default, it’s GET if you don’t specify a method. But now with this change, for special routes such as “/login” it’s POST. IMO these kinds of things make for “gotcha” moments. Just keep defaults simple without special exceptions.