<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>《请不要把 Flask 和 FastAPI 放到一起比较》的评论</title>
	<atom:link href="https://greyli.com/flask-fastapi/feed/" rel="self" type="application/rss+xml" />
	<link>https://greyli.com/flask-fastapi/</link>
	<description>一个编程和写作爱好者的在线记事本</description>
	<lastBuildDate>Wed, 05 Nov 2025 16:05:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.9.26</generator>
	<item>
		<title>作者：Kar</title>
		<link>https://greyli.com/flask-fastapi/#comment-16362</link>
		<dc:creator><![CDATA[Kar]]></dc:creator>
		<pubDate>Fri, 17 Jun 2022 12:55:54 +0000</pubDate>
		<guid isPermaLink="false">https://greyli.com/?p=3704#comment-16362</guid>
		<description><![CDATA[我想提个问题， 就是Flask更新到2之后， 原来Flask+geventwebsocket的代码好像出了点问题
```python
from flask import Flask, request
from geventwebsocket import websocket
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from typing import Set

app = Flask(&quot;&quot;)

s: Set[websocket.WebSocket] = set()


@app.route(&#039;/ws&#039;)
def ws_handler():
    ws = request.environ.get(&#039;wsgi.websocket&#039;)
    s.add(ws)
    while 1:
        try:
            data = ws.receive()
            for _ws in s:
                _ws.send(data)
        except Exception as e:
            s.remove(ws)
            break
if __name__ == &#039;__main__&#039;:
    srv = WSGIServer((&#039;0.0.0.0&#039;, 5000), app, handler_class=WebSocketHandler)
    srv.serve_forever()
```
具体的表现是 Chrome用Websocket连接服务器是连上马上断开的（状态1变3）,并且ws_handler没有任何反应，Edge也是一样， 但是火狐可以正常工作]]></description>
		<content:encoded><![CDATA[<p>我想提个问题， 就是Flask更新到2之后， 原来Flask+geventwebsocket的代码好像出了点问题<br />
&#8220;`python<br />
from flask import Flask, request<br />
from geventwebsocket import websocket<br />
from geventwebsocket.handler import WebSocketHandler<br />
from gevent.pywsgi import WSGIServer<br />
from typing import Set</p>
<p>app = Flask(&#8220;&#8221;)</p>
<p>s: Set[websocket.WebSocket] = set()</p>
<p>@app.route(&#8216;/ws&#8217;)<br />
def ws_handler():<br />
    ws = request.environ.get(&#8216;wsgi.websocket&#8217;)<br />
    s.add(ws)<br />
    while 1:<br />
        try:<br />
            data = ws.receive()<br />
            for _ws in s:<br />
                _ws.send(data)<br />
        except Exception as e:<br />
            s.remove(ws)<br />
            break<br />
if __name__ == &#8216;__main__&#8217;:<br />
    srv = WSGIServer((&#8216;0.0.0.0&#8217;, 5000), app, handler_class=WebSocketHandler)<br />
    srv.serve_forever()<br />
&#8220;`<br />
具体的表现是 Chrome用Websocket连接服务器是连上马上断开的（状态1变3）,并且ws_handler没有任何反应，Edge也是一样， 但是火狐可以正常工作</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：xixi</title>
		<link>https://greyli.com/flask-fastapi/#comment-7680</link>
		<dc:creator><![CDATA[xixi]]></dc:creator>
		<pubDate>Tue, 15 Jun 2021 00:22:18 +0000</pubDate>
		<guid isPermaLink="false">https://greyli.com/?p=3704#comment-7680</guid>
		<description><![CDATA[加油]]></description>
		<content:encoded><![CDATA[<p>加油</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：李辉</title>
		<link>https://greyli.com/flask-fastapi/#comment-7669</link>
		<dc:creator><![CDATA[李辉]]></dc:creator>
		<pubDate>Sun, 23 May 2021 06:47:05 +0000</pubDate>
		<guid isPermaLink="false">https://greyli.com/?p=3704#comment-7669</guid>
		<description><![CDATA[我不需要从使用者的角度思考，我写这篇文章是因为我认为应该区分，所以我写出来希望更多的人能够区分。这篇文章的目标受众是写那种错误对比文章的人，那种文章的读者，以及关心两者区别的用户。不关心两者区别的人，自然不会读这篇文章。]]></description>
		<content:encoded><![CDATA[<p>我不需要从使用者的角度思考，我写这篇文章是因为我认为应该区分，所以我写出来希望更多的人能够区分。这篇文章的目标受众是写那种错误对比文章的人，那种文章的读者，以及关心两者区别的用户。不关心两者区别的人，自然不会读这篇文章。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：1</title>
		<link>https://greyli.com/flask-fastapi/#comment-7665</link>
		<dc:creator><![CDATA[1]]></dc:creator>
		<pubDate>Mon, 17 May 2021 03:15:59 +0000</pubDate>
		<guid isPermaLink="false">https://greyli.com/?p=3704#comment-7665</guid>
		<description><![CDATA[看到 &quot;你怎么能让小明和骑电动车的小军赛跑然后还夸小军好快好强？&quot; 就没兴趣看下去了 感觉博主根本不是从使用者的角度在思考 而只是在维护自己开发者的身份 为了区分而区分

第一性原理建议了解一下 对于现在的调包程序员 (他们才是正常的大多数) 有多少会去看源代码的 他们用着方便就会继续用 就这么简单的道理 他们不关心司机是开汽车还是开摩托 只要快速安全地到达目的地就够了

别沉迷在自己的思维圈里了 想想 Python 为什么用的人越来越多吧]]></description>
		<content:encoded><![CDATA[<p>看到 &#8220;你怎么能让小明和骑电动车的小军赛跑然后还夸小军好快好强？&#8221; 就没兴趣看下去了 感觉博主根本不是从使用者的角度在思考 而只是在维护自己开发者的身份 为了区分而区分</p>
<p>第一性原理建议了解一下 对于现在的调包程序员 (他们才是正常的大多数) 有多少会去看源代码的 他们用着方便就会继续用 就这么简单的道理 他们不关心司机是开汽车还是开摩托 只要快速安全地到达目的地就够了</p>
<p>别沉迷在自己的思维圈里了 想想 Python 为什么用的人越来越多吧</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：laggardkernel</title>
		<link>https://greyli.com/flask-fastapi/#comment-7651</link>
		<dc:creator><![CDATA[laggardkernel]]></dc:creator>
		<pubDate>Sun, 09 May 2021 04:59:25 +0000</pubDate>
		<guid isPermaLink="false">https://greyli.com/?p=3704#comment-7651</guid>
		<description><![CDATA[FastAPI作者全职开发开源项目？我信他个鬼！280个PR开着，大部分不是被拒，根本是没有任何回复。]]></description>
		<content:encoded><![CDATA[<p>FastAPI作者全职开发开源项目？我信他个鬼！280个PR开着，大部分不是被拒，根本是没有任何回复。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Zhihao</title>
		<link>https://greyli.com/flask-fastapi/#comment-7650</link>
		<dc:creator><![CDATA[Zhihao]]></dc:creator>
		<pubDate>Thu, 06 May 2021 06:35:25 +0000</pubDate>
		<guid isPermaLink="false">https://greyli.com/?p=3704#comment-7650</guid>
		<description><![CDATA[我也是这样认为的。Flask2.0中增加了对异步的支持，也有像APIflask这样基于flask的专门编写API的二次框架，无论是开发效率和性能并不比fastAPI差。]]></description>
		<content:encoded><![CDATA[<p>我也是这样认为的。Flask2.0中增加了对异步的支持，也有像APIflask这样基于flask的专门编写API的二次框架，无论是开发效率和性能并不比fastAPI差。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：five</title>
		<link>https://greyli.com/flask-fastapi/#comment-7648</link>
		<dc:creator><![CDATA[five]]></dc:creator>
		<pubDate>Tue, 04 May 2021 11:06:30 +0000</pubDate>
		<guid isPermaLink="false">https://greyli.com/?p=3704#comment-7648</guid>
		<description><![CDATA[本质是FastAPI有更好的开发体验，就跟Vue.js的流行一样，把人聚起来了，所有问题就不是问题了。
《用它5分钟以后，我放弃用了四年的 Flask》是利用了网络传播里的规则和技巧写出来的文章。现在的网络环境，像作者这种能保持客观和理性的，算一股清流了。]]></description>
		<content:encoded><![CDATA[<p>本质是FastAPI有更好的开发体验，就跟Vue.js的流行一样，把人聚起来了，所有问题就不是问题了。<br />
《用它5分钟以后，我放弃用了四年的 Flask》是利用了网络传播里的规则和技巧写出来的文章。现在的网络环境，像作者这种能保持客观和理性的，算一股清流了。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Aber</title>
		<link>https://greyli.com/flask-fastapi/#comment-7647</link>
		<dc:creator><![CDATA[Aber]]></dc:creator>
		<pubDate>Tue, 04 May 2021 05:58:55 +0000</pubDate>
		<guid isPermaLink="false">https://greyli.com/?p=3704#comment-7647</guid>
		<description><![CDATA[刚又看了一眼一个榜单，flask 居然有 django 三倍速了，是我落伍了。待会研究研究 flask 最近做了什么更新。]]></description>
		<content:encoded><![CDATA[<p>刚又看了一眼一个榜单，flask 居然有 django 三倍速了，是我落伍了。待会研究研究 flask 最近做了什么更新。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：李辉</title>
		<link>https://greyli.com/flask-fastapi/#comment-7646</link>
		<dc:creator><![CDATA[李辉]]></dc:creator>
		<pubDate>Tue, 04 May 2021 04:37:16 +0000</pubDate>
		<guid isPermaLink="false">https://greyli.com/?p=3704#comment-7646</guid>
		<description><![CDATA[很抱歉把你的文章挑出来作为反面示例，希望没有冒犯到你。

苹果和橙汁可以比较，但这种比较是不合理不公正的（这是我想来澄清这件事的主要原因）。成年人和小孩子当然可以比武，但是这种比武不是建立在对等实力上的。我个人认为推介 FastAPI 更合理的行文方向有两种：单独介绍 FastAPI 的特性（不用和谁比较）；介绍 Flask 搭配某些 REST API 扩展相对于 FastAPI 的劣势（公平合理）。

&gt; 以后如果有一个框架基于 Flask，并且有比 FastAPI 更好的用户体验，那我也会毫不犹豫转过去的。

欢迎试试 &lt;a href=&quot;https://github.com/greyli/apiflask&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;APIFlask&lt;/a&gt;，不过它还是个新项目，或许用户体验并不优于 FastAPI。]]></description>
		<content:encoded><![CDATA[<p>很抱歉把你的文章挑出来作为反面示例，希望没有冒犯到你。</p>
<p>苹果和橙汁可以比较，但这种比较是不合理不公正的（这是我想来澄清这件事的主要原因）。成年人和小孩子当然可以比武，但是这种比武不是建立在对等实力上的。我个人认为推介 FastAPI 更合理的行文方向有两种：单独介绍 FastAPI 的特性（不用和谁比较）；介绍 Flask 搭配某些 REST API 扩展相对于 FastAPI 的劣势（公平合理）。</p>
<p>> 以后如果有一个框架基于 Flask，并且有比 FastAPI 更好的用户体验，那我也会毫不犹豫转过去的。</p>
<p>欢迎试试 <a href="https://github.com/greyli/apiflask" target="_blank" rel="noopener nofollow">APIFlask</a>，不过它还是个新项目，或许用户体验并不优于 FastAPI。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：青南</title>
		<link>https://greyli.com/flask-fastapi/#comment-7645</link>
		<dc:creator><![CDATA[青南]]></dc:creator>
		<pubDate>Tue, 04 May 2021 04:12:55 +0000</pubDate>
		<guid isPermaLink="false">https://greyli.com/?p=3704#comment-7645</guid>
		<description><![CDATA[我是《用它5分钟以后，我放弃用了四年的 Flask》的作者。感谢博主的澄清。其实我写这篇文章的用意，并不是对比两个框架谁好谁不好。我想表达的就是我用 FastAPI，用起来很爽很舒服。仅此而已。就像博主举的例子，苹果和橙汁。确实，苹果和橙汁都不是同一类东西，看起来是不应该直接拿来比较。但是，这不妨碍橙汁比苹果味道好，所以我喜欢喝橙汁，不喜欢吃苹果。我并不关心橙汁是基于什么做出来的，我只关心谁的味道好。以后如果有一个框架基于 Flask，并且有比 FastAPI更好的用户体验，那我也会毫不犹豫转过去的。]]></description>
		<content:encoded><![CDATA[<p>我是《用它5分钟以后，我放弃用了四年的 Flask》的作者。感谢博主的澄清。其实我写这篇文章的用意，并不是对比两个框架谁好谁不好。我想表达的就是我用 FastAPI，用起来很爽很舒服。仅此而已。就像博主举的例子，苹果和橙汁。确实，苹果和橙汁都不是同一类东西，看起来是不应该直接拿来比较。但是，这不妨碍橙汁比苹果味道好，所以我喜欢喝橙汁，不喜欢吃苹果。我并不关心橙汁是基于什么做出来的，我只关心谁的味道好。以后如果有一个框架基于 Flask，并且有比 FastAPI更好的用户体验，那我也会毫不犹豫转过去的。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：李辉</title>
		<link>https://greyli.com/flask-fastapi/#comment-7644</link>
		<dc:creator><![CDATA[李辉]]></dc:creator>
		<pubDate>Tue, 04 May 2021 04:07:44 +0000</pubDate>
		<guid isPermaLink="false">https://greyli.com/?p=3704#comment-7644</guid>
		<description><![CDATA[第一次见到感觉最不靠谱的是「开发速度提高 200%~300%，减少 40% 人为错误」，然后备注数据出自内部开发团队测试。

同样期待更快的 Flask。欢迎提 PR 改进它，或者去 &lt;a href=&quot;https://discord.gg/pallets&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Pallets Discord&lt;/a&gt; 的 Flask 频道聊一聊这些问题。]]></description>
		<content:encoded><![CDATA[<p>第一次见到感觉最不靠谱的是「开发速度提高 200%~300%，减少 40% 人为错误」，然后备注数据出自内部开发团队测试。</p>
<p>同样期待更快的 Flask。欢迎提 PR 改进它，或者去 <a href="https://discord.gg/pallets" target="_blank" rel="noopener nofollow">Pallets Discord</a> 的 Flask 频道聊一聊这些问题。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：Aber</title>
		<link>https://greyli.com/flask-fastapi/#comment-7643</link>
		<dc:creator><![CDATA[Aber]]></dc:creator>
		<pubDate>Tue, 04 May 2021 03:14:20 +0000</pubDate>
		<guid isPermaLink="false">https://greyli.com/?p=3704#comment-7643</guid>
		<description><![CDATA[fastapi 那个宣传语，如果是日本产品，能被法院直接强制下线，如果是中国产品，足以让法院勒令修改。

另外，很期待更快的 flask。我一直没弄明白 flask 这么慢的理由，我看源码它有很多地方为了性能而写的很别扭。]]></description>
		<content:encoded><![CDATA[<p>fastapi 那个宣传语，如果是日本产品，能被法院直接强制下线，如果是中国产品，足以让法院勒令修改。</p>
<p>另外，很期待更快的 flask。我一直没弄明白 flask 这么慢的理由，我看源码它有很多地方为了性能而写的很别扭。</p>
]]></content:encoded>
	</item>
</channel>
</rss>
