Live data from Hacker News

Flask 2.0.0 has been merged into master

github.com

51–55 of 55 posts

Re: Flask 2.0.0 has been merged into master

#51

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"]).

> This is huge. I consider this to be a minor syntactic sugar.

It’s not rocking my world, but I know which one I’d rather grep for (especially if the methods kwarg got pushed down to another line due to formatting).

Re: Flask 2.0.0 has been merged into master

#52
post #48

Earlier quoted context omitted.

Seems pretty painless to me: $ python3 -m asyncio >>> from requests import get >>> url = 'https://example.com' >>> response = await asyncio.to_thread(get, url) A lot of Python libraries now offer async APIs, have async support on their short term roadmaps, or other async projects have replaced them.

oh neat! I did not know about asyncio.to_thread; I've been using the longer form thread executor pattern.

I hadn't seen that either - looks like it's new in Python 3.9: https://docs.python.org/3/library/asyncio-task.html#asyncio....

Re: Flask 2.0.0 has been merged into master

#53
post #52
post #48

Earlier quoted context omitted.

oh neat! I did not know about asyncio.to_thread; I've been using the longer form thread executor pattern.

I hadn't seen that either - looks like it's new in Python 3.9: https://docs.python.org/3/library/asyncio-task.html#asyncio....

And if you aren't using 3.9, the anyio package has a run_async() function in its to_thread module[1] that works the same way as asyncio's to_thread() coroutine function, and the anyio solution is compatible with both asyncio and trio.

[1] https://anyio.readthedocs.io/en/stable/threads.html

Re: Flask 2.0.0 has been merged into master

#54

Earlier quoted context omitted.

Writing code by hand isn't too bad, especially with a good language like LISP. I don't think it requires too much extra effort, just more attention and care as to not make syntax mistakes. With near-instant compile times and auto-linting, we sort of lose the ability to auto-vet code before inputting it.

I think it is a bit deep than that. I love LISP to death but I would never trade a ML language for LISP for writing code that goes into production.

Many people put Lisp into production, even in very demanding environments, just fine...

Re: Flask 2.0.0 has been merged into master

#55
post #54

Earlier quoted context omitted.

I think it is a bit deep than that. I love LISP to death but I would never trade a ML language for LISP for writing code that goes into production.

Many people put Lisp into production, even in very demanding environments, just fine...

I never doubted that.
Post reply on HN