Python Bytes - #466 PSF 获得150万美元资金 封面

#466 PSF 获得150万美元资金

#466 PSF Lands $1.5 million

本集简介

本集涵盖的主题: 使用 django-click 和 django-typer 改进 Django 管理命令 PSF 获得 Anthropic 150 万美元赞助 uv 为何如此快速 PyView 网络框架 附加内容 笑话 在 YouTube 上观看 关于本节目 由我们赞助!通过以下方式支持我们的工作: Talk Python Training 的课程 《完整的 pytest 课程》 Patreon 支持者 联系主持人 Michael:@mkennedy@fosstodon.org / @mkennedy.codes(bsky) Brian:@brianokken@fosstodon.org / @brianokken.bsky.social 节目:@pythonbytes@fosstodon.org / @pythonbytes.fm(bsky) 前往 youtube.com/pythonbytes.fm/live 加入我们的观众,通常每周一美国太平洋时间上午 11 点直播。该网站也提供往期视频。 最后,如果您希望每周收到一份精心制作、手工整理的节目笔记邮件摘要?请将您的姓名和邮箱添加到我们的“节目朋友”名单,我们绝不会分享您的信息。 Brian #1:使用 django-click 和 django-typer 改进 Django 管理命令 Lacy Henschel 为您的项目扩展 Django <code>manage.py</code> 命令,用于: 数据操作 API 集成 复杂数据转换 开发与调试 Django 本身支持扩展,但使用 <code>django-click</code> 或 <code>django-typer</code>(均由 Django Commons 支持的两个项目)会让扩展更简单、代码更少、更有趣。 Michael #2:PSF 获得 Anthropic 150 万美元赞助 Anthropic 与 Python 软件基金会达成一项具有里程碑意义的资金承诺,支持安全倡议及 PSF 的核心工作。 这些资金将用于开发新工具,主动审查上传至 PyPI 的所有包,超越当前仅被动审查的流程。 PSF 计划构建一个已知恶意软件数据库,用于能力分析。 该投资将维持如“驻站开发者”计划、社区补助金以及 PyPI 基础设施等项目。 Brian #3:uv 为何如此快速 Andrew Nesbitt 这不仅仅是“用 Rust 编写”的原因。 较新的标准,如 PEP 518(2016)、PEP 517(2017)、PEP 621(2020)和 PEP 658(2022),使 uv 的许多设计决策成为可能。 而 uv 放弃了 pip 为保持向后兼容而保留的许多设计。 移除功能能提升速度。 “速度源于消除。你不需要的每一条代码路径,都是你无需等待的路径。” uv 的部分功能本可在 pip 中实现,但有些无法实现。 Andrew 讨论了不同的加速方式,以及为何某些能在 Python 中实现,而有些不能。 我因兴趣阅读了这篇文章,但它给了我很多启发:仅通过 Python,通过做出消除整个工作流的设计与支持决策,就能写出更快的工具。 Michael #4:PyView 网络框架 PyView 将 Phoenix LiveView 模式引入 Python 最近在 Talk Python 上采访了 Larry 使用服务器渲染的 HTML 构建动态、实时的 Web 应用程序 查看示例 查看 Maps 演示,体验真正的魔法 这如何可能实现?请参阅 LiveView 生命周期。 附加内容 Brian: 《升级 Django》一书深入探讨了如何逐版本升级,以及为何不直接跳到最新版本,还有哪些人可能想通过跳过版本节省时间。 书中还列出了所有版本及其发布和停止支持日期。 《精益 TDD》一书初稿已完成。 现已通过 pythontest 和 LeanPub 发布。 我将其标记为 80% 完成,因计划后续修订。 我正在处理一些提交的建议。反馈不多,因此第二轮修订可能很快,主要由我自行修改,这是有可能的。 我正在重读,已对引言第一页感到失望,必须让它更出彩,我会改进。 正在考虑应加入多少关于使用 AI 的建议。 书中尚未提及,但我认为有必要加入相关内容。 Michael: Python:2026 年将有哪些新特性 Python Bytes 重写为 Quart + async(与 Talk Python 的旅程非常相似) 在 Talk Python To Me 中添加了正式的 MCP 服务器(您无需正式的 MCP 框架) 示例一:latest-episodes-mcp.png 示例二:which-episodes-mcp.webp 为 Talk Python To Me 实现了 /llms.txt(参见 talkpython.fm/llms.txt) 笑话:逆超人

双语字幕

仅展示文本字幕,不包含中文音频;想边听边看,请使用 Bayt 播客 App。

Speaker 0

你好,欢迎收听Python Bites,我们将Python新闻和头条直接送到你的耳机里。

Hello, and welcome to Python Bites, where we deliver Python news and headlines directly to earbuds.

Speaker 0

这是第466期,录制于2026年1月19日星期一。

This is episode 466 recorded Monday, 01/19/2026.

Speaker 0

我是迈克尔·肯尼迪。

I'm Michael Kennedy.

Speaker 1

我是布莱恩·奥欣。

And I'm Brian Auchin.

Speaker 0

本集由我们自己赞助,All Over Things。

This episode is brought to you by us, All Over Things.

Speaker 0

我知道布莱恩最近在TDD方面非常专注,稍后他会详细和大家分享,但他还有即将出版的书和课程。

I know Brian is very lean these days with his TDD and would like to tell you about it more on that later, but he's got his upcoming book and course.

Speaker 0

我的《TalkBython实战》一书依然非常畅销。

I've got my TalkBython in production book, which is still going strong.

Speaker 0

我很喜欢这一点。

I love that.

Speaker 0

当然,我们所有的课程之类的内容。

Of course, all of our courses, things like that.

Speaker 0

另外,关注我们的社交媒体,大多数平台的链接都在节目说明中,你的播客播放器和Sean那里。

Also, with us on social media, links for most of the places that you might do so in the episode show notes, your podcast player and Sean.

Speaker 0

所以,最终别忘了订阅我们的通讯。

So when finally, subscribe to the newsletter newsletter.

Speaker 0

我们会在里面分享很棒的内容。

We're putting awesome things in there.

Speaker 0

远不止节目说明那么简单。

Lots more than just the show notes.

Speaker 0

所以,如果你喜欢的话,这算是一种不错的补充,提供一些额外的资源。

So it's kind of a nice reinforcement, a few extra resources if you like them.

Speaker 0

是的。

Yeah.

Speaker 0

这些内容主要由Brian整理,我们非常感谢你,Brian。

Mostly put together by Brian, so we appreciate that, Brian.

Speaker 0

谢谢。

Thanks.

Speaker 0

是的。

Yeah.

Speaker 0

当然。

You bet.

Speaker 0

我也很欣赏一个拥有坚实社区的优秀Web框架。

I also appreciate a good web framework with a solid community.

Speaker 0

在这个领域你有什么推荐吗?

What do you got in that realm?

Speaker 1

我们会聊聊Django。

Well, we're gonna talk about Django.

Speaker 1

把这个放在这里。

Put this up here.

Speaker 1

Django,我看到一篇六个月前来自revsys的文章。

Django, I ran across this article about that's it's six months old from the revsys.

Speaker 1

这是2025年6月的,但我一直把它列在待办事项里,打算讲一讲。

It's from June 2025, but I had it in my queue and going to cover it.

Speaker 1

所以是关于使用Django Click和Django Typer来改进Django管理命令。

So better Django management commands with Django click and Django typer.

Speaker 1

这篇文章来自Lacey Henschel。

And this is from Lacey Henschel.

Speaker 1

那我们来看看这些管理命令吧。

And so let's look at the management commands.

Speaker 1

任何用过Django的人都知道,它有很多管理命令。

If anybody that's used Django, you know, there's management commands, there's a bunch of them.

Speaker 1

你可以直接在Django项目里运行manage.py命令,或者用django-admin命令,也可以用python -m django后面跟命令。

So there's there's you just say like, man, if you go if you're in the Django thing, can go manage up by command or you can do Django admin command or Python dash M Django, then the command.

Speaker 1

内置的命令有很多。

There's a bunch of built in ones.

Speaker 1

而且像网站维护这类事情和其他功能都需要用到它们。

And since there are things like just the maintenance around your website stuff and other things.

Speaker 1

但那里有很多内容,而且非常方便,如果你能自己添加一些就更好了。

But there's there's there's a lot of stuff there and it's so convenient that it'd be cool if you could add your own.

Speaker 1

而且内置了一些功能。

And there is built in stuff.

Speaker 1

你可以通过继承来创建自定义命令。

You can create custom commands, you do it by deriving.

Speaker 1

你必须继承一个基础命令类,并且到处都要用 self。

You have to derive from a base command class and then and have self everywhere.

Speaker 1

这里涉及到了面向对象的那部分机制。

There's this there's the door, this the, you know, object oriented part of that.

Speaker 1

这有点奇怪。

That's weird.

Speaker 1

但还有更好的方法可以实现。

But there's other there's better ways to do.

Speaker 1

至少有不同的实现方式。

There's there are at least different ways.

Speaker 1

如果这不适合你,还有更好的方法。

If this doesn't jive with you, there's better ways.

Speaker 1

这正是我们正在讨论的内容。

And that's what we're talking about.

Speaker 1

这涉及到 Django Click 和 Django Typer。

This is with Django Click and Django Typer.

Speaker 1

首先,一个很酷的地方是她解释了为什么你需要添加自己的管理命令。

So first off, one of the cool things is she runs down why you would want to add your own management commands.

Speaker 1

有很多很好的理由,比如数据操作和导入。

And there's a lot of great reasons like data operations importing.

Speaker 1

她举了一个从客户那里导入 CSV 文件、导出报告数据的例子。

She has an example of importing CSV file from clients, exporting data for reports.

Speaker 1

这些都是很棒的功能。

Those are great things.

Speaker 1

你在系统上执行这些操作,但可以直接使用 Django 的相同内部机制来提取数据。

You're doing it on the system, but you can just go use the same internals of Django to be able to pull things out.

Speaker 1

这很棒。

That's great.

Speaker 1

还有开发和调试,这是我最喜欢的理由之一。

Also, development and debugging, one of my favorite reasons.

Speaker 1

好的。

Okay.

Speaker 1

首先,Django Click 和 Django Typer 都基于 Click,而 Click 本身也是创建命令行工具的绝佳方式。

So the the first off, Django Click and and Django Click is is just is is based on Click, of course, and Click is a great way to do CLI tools too.

Speaker 1

因此,这只是将 Click 与 Django 集成,以实现这些管理命令,你最终只需创建一个文件即可。

And so it's it's just an integration of Click and Django to get these management commands and you end up just creating a file with it.

Speaker 1

使用一些 Click 选项,代码会简洁很多,这正是 Click 的集成优势。

And it's a lot shorter with with some do click options and stuff, and it's just that integration of click.

Speaker 1

此外,Typer 也是基于 Click 构建的。

And then again, typer is also and is built on click also.

Speaker 1

但如果你习惯使用 Typer,那就直接用 Typer 吧。

But if you're used to typer, grab typer.

Speaker 1

但 Typer 的一个酷炫之处在于它的着色和不同的输出效果。

But one of the cool things about typer is the coloring and the different the output.

Speaker 1

你可以实现更结构化的输出。

You can do more structured output.

Speaker 1

它们有一个示例,展示了更好的功能,比如支持表情符号、表格等。

So they have an example where you can we have like better things like emoji support and tables and things like that.

Speaker 1

如果你想做一些酷炫的东西,这篇文章就提到:那到底该用哪个呢?

If you want to do cool And that's The article goes in and says, Hey, well, which one should you use?

Speaker 1

我就不往下滚动了,但到底该用哪个呢?

I'm not going to scroll the bottom, but which one should you use?

Speaker 1

她通常会选用 Django Click,但当她想做漂亮的报表之类的东西时,就会选择 Django Typer。

It's basically she usually reaches for Django click, but when she wants to do nice reports and stuff to Django typer.

Speaker 1

它们都受到什么支持呢?

And they're both supported under what is it?

Speaker 1

Django Commons 在 GitHub 上的小组支持这两个额外的插件。

The the Django Commons and group on on GitHub supports both of these these extra plug ins or whatever.

Speaker 1

所以很酷。

So pretty cool.

Speaker 0

是的。

Yeah.

Speaker 0

真的很不错。

Was really nice.

Speaker 0

Qlik 和 Typer 显然非常流行。

Qlik and Typer are obviously super popular.

Speaker 0

如果你觉得:我知道其中一个,但我想添加一个自定义的 Django 命令,那就直接做吧。

And if if you're like, I know one of those, but I wanna add a custom Django command, like, let's just do it.

Speaker 0

我知道我这么说,听起来可能有点奇怪。

You know, I'm I imagine I say this as I say this.

Speaker 0

我确信它肯定存在,但我完全不知道它是什么。

I'm sure it's out there, but I have no awareness of its existence.

Speaker 0

如果能有一个文本界面就好了,比如你只需输入 manage pi 或 manage tx 之类的命令,就能看到所有这些管理型 Django 命令的界面,那也很酷。

It would also be cool to have a textual sort of UI if you could just type manage pi ish, manage t x or whatever, and you get, like, a UI for all these managed Django commands.

Speaker 0

那会很酷,包括你自定义的那些。

That'd be pretty neat, including your custom ones.

Speaker 0

probably 已经存在了。

Probably out there.

Speaker 0

我对它一无所知。

I have no idea about it.

Speaker 0

所以也许有人会给我们发消息。

So maybe someone will send us a message.

Speaker 0

我们可以做个后续跟进。

We can do a follow-up.

Speaker 0

你知道的,这是个老生常谈的问题,布莱恩。

You know, it's the the age old question, Brian.

Speaker 0

如果你有一百万美元,你会怎么做?

What would you do if you had a million dollars?

Speaker 0

想象一下有一百万美元。

Think of a million dollars.

Speaker 0

你再也不必对社会卑躬屈膝了。

You never have to be subservient to society again.

Speaker 0

嗯,也许情况没那么绝对。

Well, maybe it's not quite that way.

Speaker 0

但我们真的

But do we have really

Speaker 1

我觉得我需要的不止一半。

I think I'd need more than a half.

Speaker 0

你需要的不止一半,因为通货膨胀。

You would need more than a half because inflation.

Speaker 0

你实际上可能需要超过一百五十万美元。

You would actually need more than one and a half probably.

Speaker 0

但有一百五十万美元,你肯定能产生不小的影响。

But you could sure make a dent with 1 and a half million dollars.

Speaker 0

这真是个好消息,因为Anthropic刚刚向PSF在开源安全领域投资了150万美元。

And that is really good news because Anthropic has just invested 1,500,000 in the PSF in open source security.

Speaker 1

太棒了。

That's awesome.

Speaker 0

我想花一分钟,真心感谢你们,Anthropic。

I wanna take a minute and just, you know, thank you, Anthropic.

Speaker 1

哇哦。

Woo hoo.

Speaker 0

人们总是批评AI公司。

People hate on AI companies.

Speaker 0

所以我今天要特别表彰一下

So I throw a special today above all

Speaker 1

为我们带来了Claude。

to bring us Claude.

Speaker 1

对吧?

Right?

Speaker 0

是的。

Yeah.

Speaker 0

Claude、Opus、Claude Sonnet、Claude Code。

Claude, Opus, Claude Sonnet, Claude Code.

Speaker 0

而且说实话,我一直用Claude,我觉得claude.ai就是ChatGPT的替代品。

And just honestly, I I've been using Claude, just Claude I think it's claude.ai as, like, the chat GPT alternative.

Speaker 0

最近ChatGPT变得越来越差了,我不明白为什么。

Chat GPT has gotten really less good lately, and I don't understand.

Speaker 0

这很奇怪。

It's weird.

Speaker 0

比如,我刚才在写一篇博客文章,稍后我会提到,它总是假定一些事情,而我觉得Claude在做很多这方面的工作。

Like, I was just writing a blog post, which I'll talk about later, and it's just doing a assuming things that I found, like, Cloud is doing a lot of stuff.

Speaker 0

我认为它确实是最好的AI之一。

I think it's honestly one of the better AIs.

Speaker 0

如果这些公司都要赚大钱并互相交换利益,我真的很希望Anthropic能把这些钱重新投入Python。

And if all these companies are gonna make all this money and exchange it around, I really like to see Anthropic putting this money back into Python.

Speaker 0

你知道,这不仅仅是Python的问题。

You know, they're they're it's not just Python too.

Speaker 0

他们刚收购了Bunn,据我理解,这有点像Node的一个替代方案。

They just bought Bunn, which is like, as far as I understand, it kinda like a node alternative.

Speaker 0

而且他们还花了一大笔钱买下了这个JavaScript运行时工具。

Certainly a Java script runtime thing for a ton of money as well.

Speaker 0

所以他们在做这些事,我的意思是,他们并没有收购PSF。

So they're they're doing I mean, they're not they didn't buy the PSF.

Speaker 0

他们只是直接给了钱。

They just gave money.

Speaker 0

这已经持续两年多了。

So this is over two years.

Speaker 0

那这到底意味着什么?

So what is that?

Speaker 1

PSF并不出售。

PSF isn't for sale.

Speaker 1

它又不是格陵兰岛。

It's not like Greenland or anything.

Speaker 0

我的意思是,我认为我们都知道,他们拒绝了美国政府最近提供的150万美元资助,这背后肯定不是巧合,因为那笔钱附带了很多条件。

Well, I mean, I think we know that because the they're turning down of that, probably not a coincidence, $1,500,000 offered by the recent US government with strings attached.

Speaker 0

这笔资金基本上没有附加条件。

This one comes without strings, more or less.

Speaker 0

我确信还是有一些条件的,但程度没那么严重。

I'm sure there are strings, but not to the same degree.

Speaker 0

但这实际上是每年75万美元,让我想想。

But it's really $750,000 a year, and it has let me see.

Speaker 0

我记了一些关于这笔资金具体目标的笔记,但主要是为了支持Python安全,来自YRCM,同时也用于资助如驻场开发者计划之类的项目。

I took some notes on exactly the goals of this, but it's basically mostly for Python security from YRCM, but also to fund things like the developer in residence initiative.

Speaker 0

社区资助,记得之前关于资助被暂停或取消的风波吧。

Community grants, which remember there was a big kerfuffle about grants being paused or canceled.

Speaker 0

是的。

Yeah.

Speaker 0

因为他们没钱了。

Because they ran out of money.

Speaker 0

对吧?

Right?

Speaker 0

我的意思是,这很糟糕,也许他们承诺了但没有兑现。

I mean, it sucks, and maybe they promised it and then didn't deliver it.

Speaker 0

我不记得了。

I don't remember.

Speaker 0

我感觉好像有过类似的事情。

I feel like there was something like that.

Speaker 0

但即使你承诺了,如果钱没了,也不能说,嗯,你为PSF工作。

But even if you promised it, if the money's gone, it's not like, well, you work for the PSF.

Speaker 0

让我把你的401(k)给我,这样我们才能兑现承诺。

Let me have your your four zero one k so we can keep our promise.

Speaker 0

你知道,到了某个时候,如果钱没了,那就是没了。

You know, at some point, if the money's not there, the money's not there.

Speaker 0

所以这真的很棒,这是像PyPI这样的VAC基础设施。

So this is really awesome that this is VAC infrastructure like PyPI.

Speaker 0

我时不时会说,但我不确定有多少人知道,如果没有Fastly提供的免费CDN带宽,运行PyPI的成本有多高。

Like, I say this every now and then, but I'm not sure how people how many people understand how expensive PyPI is to run if it were not for fast fast to leave the CDN giving free bandwidth.

Speaker 0

每个月的开销高达十万美元以上,这可不是小数目。

The it's a $100,000 or more a month, the man with some money.

Speaker 0

我的意思是,相比整体预算,这已经是一笔巨款了,对吧?

I mean, it's a lot of money, right, compared to the overall budget.

Speaker 0

相比整体预算,这确实是一笔不小的开销。

And this is a lot of money compared to the overall budget.

Speaker 0

我觉得PSF的预算大约是七百万美元。

I feel like the budget of the PSF is around 7,000,000.

Speaker 0

我好几年没去查了,但上次听说大概是这个数。

I mean, I haven't checked in the last couple of years, but last time I heard it was something like that.

Speaker 0

所以这笔开销占了预算的相当大一部分。

So this is a significant portion of that.

Speaker 0

还有别的吗?

Anything else?

Speaker 0

是的

Yeah.

Speaker 1

所以,根据我找到的最新文章,当前CDN的费用是每月150万美元。

So The current CDN cost, last article I found is 1,500,000.0 a month.

Speaker 1

每月。

A month.

Speaker 1

这不可能是对的。

That that can't be right.

Speaker 1

不。

No.

Speaker 1

它只是

It's

Speaker 0

我觉得这个数字太高了。

I feel like that's high.

Speaker 0

我的意思是,我知道这很高,但我觉得即使这个数字也太高了。

I mean, I know it's high, but I feel like even that's high.

Speaker 1

但是

But

Speaker 0

这可能是按年计算的。

it might be a year.

Speaker 0

它确实是,但我也不确定。

It it but I don't know.

Speaker 0

我可能错了。

I could be wrong.

Speaker 0

实际上,网上有一篇非常好的文章,讲的是PSF的统计数据,但我没有参与撰写,只是间接听说,所以现在手头没有这篇文章。

There's actually a really nice article written up somewhere that I didn't make any part of our news that about the stats of the PSF, but I just heard it indirectly, so I don't have have it to pull

Speaker 1

调取。

up.

Speaker 0

无论如何,其中一个目标是开发一套有趣的新型自动化工具,用于主动审查上传到PyPI的所有软件包,超越仅被动审查的模式。

Anyway, so one of the goals is it's a fun new automated tools for proactively reviewing all packages uploaded to PyPI, moving beyond a reactive only review process.

Speaker 0

还记得几周前,我提到过,嘿。

Remember a few weeks ago, I talked about, hey.

Speaker 0

这就是你如何设置 Python 供应链安全的方法。

Here's how you set up, like, Python supply chain security.

Speaker 0

其中一种主要方式,老实说,就是等一段时间再安装,然后看看是否有人报告了问题。

And one of the main ways, on honestly, is wait a little while to install it and then check if a problem has been reported.

Speaker 0

这其实是一种被动应对的方式。

It's kind of the reactive thing.

Speaker 0

就像,如果某个重要包出了问题,很可能几天内就会有人发现并做出反应。

It's like, well, probably somebody, if something happens to a major package, will figure it out within a few days and react to it.

Speaker 0

所以,如果不用这样被动应对,难道不好吗?

So wouldn't it be nice if that didn't have if it didn't have to happen that way?

Speaker 0

确实如此。

It would.

Speaker 0

你知道,事情就是这么发生的。

You know, that is how it happens.

Speaker 0

明白吗?

Alright?

Speaker 0

他们,也就是PSF,计划建立一个已知恶意软件的全新数据集,用于能力分析。

And they the PSF plans to build a new dataset of known malware for capabilities analysis.

Speaker 0

所以还有很多其他不错的内容。

So all sorts of good stuff.

Speaker 0

我只是想强调一下这件事,感谢Anthropic,我认为这对PSF和所有人来说都真的很棒。

I just wanted to shine a light on this, say thank you Anthropic, and yeah, it's really great for PSF and and everyone, I think.

Speaker 1

嗯,我确实注意到了这一点,而且还有几个人向我们提到了安德鲁·内斯比特的一篇文章,《UV为何如此之快》。

Well, I we got this I did notice this, but I also a couple of people mentioned it to us, an article by Andrew Nesbitt, How UV Got So Fast.

Speaker 1

这篇文章有很多地方让我喜欢。

And there's a lot of reasons why I like this article.

Speaker 1

首先,文章开篇就提到,通常的解释是它用Rust编写。

First off, just right off the top of the bat that says, Hey, usual explanation is it's written in Rust.

Speaker 1

这正是我们通常所认为的,对吧?

And that's kind of what we think is, right?

Speaker 1

你可以把Python工具重写成Rust,它们就会变得更快。

You can take Python tools, rewrite them in Rust and they'll be faster.

Speaker 0

但这还远远不够

But it's a lot more

Speaker 1

不仅如此。

than that.

Speaker 1

Rust部分当然有贡献,但还有一些优化和设计决策让它快了很多。

The Rust part is contributing, of course, but there's some tweaks around it and also some design decisions that make it a lot faster.

Speaker 1

读起来很有趣。

It's interesting to read.

Speaker 1

其中一个方面是关于标准。

So one of the things is around the standards.

Speaker 1

为了实现这一点,出现了一系列标准。

So there's a bunch of standards that came in to make this possible.

Speaker 1

其中PIP518创建了PIProject。

There's PIP518 that created PIProject.

Speaker 1

Toml。

Toml.

Speaker 1

UV 读取 pyproject.toml。

UV reads PIProject.

Speaker 1

Toml。

Toml.

Speaker 1

它不读取 setup.py。

It doesn't read setup.

Speaker 1

Py。

Py.

Speaker 1

你不能做其他任何事情。

You can't do any other stuff.

Speaker 1

你必须使用 wheel 包。

You have to do wheels.

Speaker 1

这正是 UV 所寻找的。

That's what UV looks for.

Speaker 1

另外,实际上,我可能说错了。

Also, actually, I could be wrong.

Speaker 1

我觉得我有点夸大了。

I think I'm overstating that.

Speaker 1

我认为它确实支持向后兼容,并且只是回退到两种不同的模式。

I think it does do backwards compatible stuff and it just falls back to two different modes.

Speaker 1

好吧,我得再确认一下,但我觉得是这样的。

Well, I'll have to double check that, but I think so.

Speaker 1

无论如何,PEP 517 是在2017年推出的,它将构建前端和后端分离开来。

Anyway, PEP five seventeen or is was came in in 2017, which is a separate build build front ends and back ends.

Speaker 1

所以现在,就连 PEP 也不需要了解子工具的内部细节了。

So now even PEP doesn't need to understand subtools internals.

Speaker 1

还有 PEP 621,它标准化了 TOML 文件中的 [project] 表格以及读取 TOML 表格的方式。

There's PEP six twenty one that standardized the bracket project table within the TOML file and reading a tables TOMLs.

Speaker 1

还有 PEP 658,它将包元数据直接集成到简单仓库 API 中。

And then there's the PEP six fifty eight, which was package metadata directly in the simple repository API.

Speaker 1

本质上,当你安装某个包时,后端不需要再依赖工具去获取大量数据。

Essentially, you don't the tools on the back when you do install something, they don't have to grab a whole bunch of data.

Speaker 1

他们只需要获取这种依赖信息,而以前他们必须这么做。

They just have to grab like this this dependency information which they used to have to.

Speaker 1

关于 PIP 以前必须去下载、尝试各种东西再运行,这里还有更多故事。

There's more of a story here about how PEP PIP used to have to go out and just really download, try stuff and then try to run it.

Speaker 1

如果不行,就试别的。

If it didn't work, try something else.

Speaker 1

那里还有很多内容。

There's a bunch of stuff there.

Speaker 1

不过,还不止这些。

There's there's more than that, though.

Speaker 1

有了这些机制之后。

There's these having these in place.

Speaker 1

基本上,如果说 UV 在 2020 年就发布,那是不可能的,因为当时这些机制都还没到位。

Basically, says, you know, UV could not have shipped in 2020 because these all these weren't in place.

Speaker 1

所以它依赖于所有这些条件。

So it relied on everything.

Speaker 1

PIP 658 于 2023 年 5 月在 PIP 6 中上线,而 UV 则于 2024 年 2 月发布。

PIP six fifty eight went live in PIP six in May 2023 and UV launched February 2024.

Speaker 1

所以它是在所有这些基础上构建的。

So it's building on top of all those things.

Speaker 1

此外,UV 去掉了不少东西。

Also, UV drops a bunch of stuff.

Speaker 1

PIP 仍然支持大量老旧内容,但 UV 完全不支持这些。

A PIP still supports a lot of old old stuff, which UV just doesn't like egg support.

Speaker 1

PIP Conf 也不支持这些。

PIP Conf doesn't support that.

Speaker 1

默认情况下没有字节码编译。

There's no byte code compilation by default.

Speaker 1

我之前没意识到这一点。

I didn't realize this.

Speaker 1

所以是的,当你用 pip 安装某个包时,默认会遍历并生成 PYC 字节码文件,即将代码转换为 PYC 字节码对象。

So yeah, when when you pip install something it by by default like goes through and does PYC converts byte code or converts code to PYC byte code objects.

Speaker 1

UV 不会这样做。

UV doesn't do this.

Speaker 1

显然你可以开启这个功能,但它默认不会执行。

You can apparently you can turn it on, but it doesn't do it by default.

Speaker 1

需要虚拟环境吗?

Requires virtual environments?

Speaker 0

看起来它可能是可以缓存的,你知道的?

It seems like it could be cached, you know?

Speaker 0

是的。

Yeah.

Speaker 0

但我也不太清楚 UV 是如何将它与 Python 版本关联的,也许缓存方式会不一样。

But but I guess I don't know how UV pairs that to Python versions, and maybe it gets cached differently.

Speaker 0

你用 Python 3.13 来编译它们,可能根本没必要,你知道的?

You run, like, Python three thirteen to compile them, you know, it's maybe it's just like not worth it, you know?

Speaker 1

是的,我会快速过一遍这些更严格的规范强制执行,忽略 Python 的上限版本,因为项目里都说:我没在 Python 4 上测试过,所以别用。

Yeah, I'll just run through these quick stricter spec inform enforcement, ignoring the upper bound on Python because projects say, you know, I I haven't tested on four, so don't do that.

Speaker 1

但通常它还是能正常工作的。

But it usually works anyway.

Speaker 1

所以我没意识到他们忽略了这一点。

So I didn't realize they ignored that.

Speaker 1

另外,第一个索引优先。

Also, first index wins.

Speaker 1

我不明白为什么PIP在获取一个包之前要检查所有索引,但UV却直接停止。

I don't know why PIP checks all of the indices before it grabs one, but UV stops.

Speaker 1

所以开头提到,速度来自于减少不必要的步骤。

So there's at the top it talks about speed comes from elimination.

Speaker 1

基本上,你不需要走的每一条代码路径,都是你不需要等待的时间。

Basically every code path you don't have to go down is code you don't have to wait for.

Speaker 1

而且这也是一个新项目,所以你不需要破坏向后兼容性。

And also it's a new project, so you're not breaking backwards compatibility.

Speaker 1

如果UV无法工作,就使用PIP。

If UV doesn't work, use PIP.

Speaker 1

正如Sempas提到的,新项目在从零开始构建时,可以放弃或绕过许多东西,这很好。

Like Sempas mentioned, there are many things a new project can afford to drop or work around when building from ground up, which is good.

Speaker 1

这表明了我们能够拥有什么。

It shows as it shows that we can what we can have.

Speaker 1

是的。

Yeah.

Speaker 1

基本上,你可以从头开始,这很棒。

Basically, you you you could start from scratch, which is great.

Speaker 1

另一个有趣的地方是,有一系列不依赖Rust的优化,这很有趣。

The the other interesting things is there's a bunch of optimizations that don't that don't rely on Rust, which are interesting.

Speaker 1

比如,因为它只查看轮子文件,所以可以查看轮子或zip归档的末尾来获取目录列表,诸如此类。

Like, there's a there's a using because it's only looking at wheels, it can it can wheels or zip archives, it can look at the end of the wheel first to grab the the directory list, things like that.

Speaker 1

并行下载。

Parallel downloads.

Speaker 1

这你知道,任何语言都可以做到。

This is you know, any language could do that.

Speaker 1

PIP 也可以做并行下载,但它没有。

PIP could do parallel downloads, but it doesn't.

Speaker 1

全局缓存。

The global cache.

Speaker 1

我们用 UV 时经常看到这种情况:当你用 UV 下载或安装某个包时,它会缓存到某个地方。

We've we've seen this with UV a lot is when you download some or PIP install something from UV with UV, it caches it somewhere.

Speaker 1

所以如果你创建另一个虚拟环境,它已经在那里了。

So if you create another virtual environment, it's gonna be there already.

Speaker 1

不需要重新下载,这很棒。

It doesn't have to download again, which is great.

Speaker 1

总之,这里有很多酷炫的功能。

Anyway, bunch of cool things here.

Speaker 1

但其中一个我喜欢这篇文章、也喜欢这个想法的原因是,我无法让它更快,因为我现在打算继续用 Python。

But they so one of the reasons why I love I like the article, but also I like the idea of thinking I can't speed it up because I'm gonna stick with Python for now.

Speaker 1

你可以做一些权衡。

There are tradeoffs that you can do.

Speaker 1

你可以在项目中做一些改动,尤其是那些你完全掌控的项目,你可以想:嘿,你知道吗?

You can make some changes in projects, especially ones you completely control that you can say, well, you know what?

Speaker 1

我要去掉一些以前支持的假设和使用模式,只是为了让它更快。

I'm going to take away some of the assumptions and some of the use models that I used to support and just to make it faster.

Speaker 0

亨利指出,由于没有 PYC 文件,首次导入会变慢,我觉得是这样。

Henry points out there, this makes the first import slower for not having PYC, I think.

Speaker 1

是的。

Yeah.

Speaker 0

如果你不使用整个包,这确实能节省时间。

It's an actual savings if you don't use the entire package.

Speaker 0

不过,我想这取决于这种情况发生的时间。

Though, I guess it's the it depends on when this is happening.

Speaker 0

对吧?

Right?

Speaker 0

比如,如果这是在你本地的虚拟环境中发生的,那其实无所谓。

Like, if this is happening on v and v m on your machine, like, yeah, it doesn't really matter.

Speaker 0

比如,第一次运行之后,速度就快了。

Like, after the first run, it's fast.

Speaker 0

如果这是在 Docker 环境中启动时发生的,每次启动都使用新的 Docker 容器,那么每次都会发生,这就不太好了。

If it's happening on startup on a Docker thing where every time it starts, it uses the new Docker container, well, then it happens every time, and it's not great.

Speaker 0

是的。

Yeah.

Speaker 0

这让我在想,也许我可以写个脚本,在 UV 没有做的情况下,预先编译 VNV 中安装的所有内容,从而提升启动速度。

It's making me wonder if maybe I can get better startup speed by running a script to precompile everything installed in the VNV if UV is not doing it.

Speaker 0

我会告诉你的。

I'll let you know.

Speaker 1

有意思。

Interesting.

Speaker 1

我不明白为什么 PIP 会查看所有的索引。

I I didn't understand why PIP looks at all of the indices.

Speaker 1

亨利·谢纳说,当你在不同索引上有一个较新版本时,查看所有索引是很重要的,有时候你确实需要这么做。

Henry Scheiner says looking at all the indices is important when you have a newer version on a different index, which sometimes you need to do.

Speaker 1

你有时候确实需要这样做,但查看所有索引会更慢。

You sometimes you do need to, but it is slower to look at all of them.

Speaker 1

所以,当你有多个时,你可以这样做。

So, you can when you have multiple.

Speaker 1

是的,这有点像内行话,但你可以配置你的PIP,设置多个来源来获取包,比如内部源之类的。

Yeah, this is sort of like inside baseball, but you can set up your your PIP configuration so you have multiple places where you're grabbing things like an internal and stuff.

Speaker 0

是的。

Yeah.

Speaker 0

不过,PIP在不破坏任何历史兼容性的情况下,仍有提升速度的空间。

There are opportunities, though, for PIP to speed up without breaking any of its historical compatibility.

Speaker 0

对吧?

Right?

Speaker 0

比如,理论上它可以知道,你通过要求安装十个包,无论是用 -r requirements.txt 还是 pyproject.toml 之类的。

Like, it theoretically could say, you asked me to install 10 things when you said dash r requirements or high project dot toml or whatever.

Speaker 0

让我们并行获取这些包。

Let's go get those in parallel.

Speaker 0

让我们并行运行安装。

Let's run the install in parallel.

Speaker 0

对吧?

Right?

Speaker 0

比如,我们每个人都有十个、十四个、二十个,不管多少个核心。

Like, we all have ten, fourteen, 20, whatever cores.

Speaker 0

对吧?

Right?

Speaker 0

别只用一个核心运行。

Like, don't run it on one.

Speaker 0

而且我们的网络可能比这还快。

And we probably have faster than that.

Speaker 0

别只用一个连接运行。

Don't just run it on one connection.

Speaker 0

等等。

So on.

Speaker 1

是的。

Yeah.

Speaker 1

另外,缓存这部分我很喜欢,就是缓存它,为像我这样经常创建虚拟环境的人提供一个本地缓存。

Also, the the caching is it I love that part of, like, just caching it, having a machine local cache for for the

Speaker 0

you

Speaker 1

知道,对于像我这样经常创建虚拟环境的人来说。

know, for people like me that create I create virtual environments all the time.

Speaker 0

我也是。

So do I.

Speaker 1

所以它们看起来几乎是免费的。

So they just seem free.

Speaker 0

是的。

Yeah.

Speaker 0

尤其是用 UV 的时候。

Especially with UV.

Speaker 0

最后,观众席上的亨利提出了——compile-bytecode。

And finally, Henry out in the audience throws out dash dash compile dash byte code.

Speaker 0

我猜这是给UV的一个命令。

I'm assuming that's a command to UV.

Speaker 0

是的。

Yeah.

Speaker 0

如果是的话,我一些安装环境很快就会设置这个。

And if it is, it's getting set on some of my installs here soon.

Speaker 0

太棒了。

Awesome.

Speaker 0

好了,我们转到PyView网页框架吧。

Alright, let's switch gears here to the PyView web framework.

Speaker 0

好的。

Okay.

Speaker 0

所以PyView,最近确实也出现了其他类似的东西。

So PyView now there have been other things like this recently out there.

Speaker 0

有个叫 PyWebView 的东西。

Something called PyWebView.

Speaker 0

不是那个。

Not that.

Speaker 0

PyWebView 是一个可以嵌入浏览器的技术,有点像 Electron。

PyWebView was a thing where you could embed basically a a browser kind of like Electron would.

Speaker 0

所以这并不是那个。

So this is not that.

Speaker 0

这是一个完全不同的网页框架,非常有趣。

This is a totally separate web framework that's super interesting.

Speaker 0

我刚刚在《Talk Python》上采访了这个项目的创始人 Larry。

I just interviewed Larry, who's behind the project over on Talk Python.

Speaker 0

它在 YouTube 上是直播形式。

It's on YouTube as a livestream.

Speaker 0

它还尚未作为播客节目发布。

It is not yet out as a podcast episode.

Speaker 0

所以很快就会在您附近的播客播放器中上线。

So coming soon to a podcast player near you.

Speaker 0

它基于一个叫 Phoenix Live View 的东西,而这个东西居然是用 Elixir 写的。

It's based on this thing called Phoenix Live View, which is written in Elixir of all things.

Speaker 0

但我们的想法是想要一个非常响应式的前端代码。

But the idea is we wanna have very reactive front end code.

Speaker 0

对吧?

Right?

Speaker 0

就像 React、Vue 或者类似的东西那样。

Kind of like React, the name, or Vue or something like that.

Speaker 0

但我们更希望用 Python 代码来控制它,让大部分逻辑在服务器端完成,有点像 HTMX 的感觉。

But we would rather have Python code controlling it and have it more done on the server, a little bit like an HTMX vibe.

Speaker 0

明白吗?

Okay?

Speaker 0

所以它基于更广为人知的 Phoenix Live View,因为这个技术已经存在很长时间了,很多人可能听说过。

So what this does is it's based on this more popular, because it's been around a lot longer, Phoenix Live View, which people may have heard.

Speaker 0

所以你要做的就是在服务器上编写代码,就好像它能直接更新前端一样。

So what you do is you write code on the server as if it could it could update the front end directly.

Speaker 0

当你启动应用时,整个框架会建立一个从后端到客户端的 WebSocket 连接,并发送事件,这些事件就像 JavaScript 事件一样,但实际是在服务器端触发的。

When you launch your app, what happens is it actually this whole framework sets up a WebSocket connection from the back end and sends events to you that happen as if they were JavaScript events, but they happen on the server.

Speaker 0

当这些事件发生时,你只需重新渲染页面,系统会有一个差异引擎来判断:虽然你发送了整个页面,但实际上只有这个 div 和那个 div 需要更新,然后它只把这些部分发送过去。

When those events happen, you just rerender the page, and there's a diffing engine that figures out like, okay, you sent the whole page, but actually it's just this this div and that div that need to go down, and it it sends them over.

Speaker 0

所以让我给你演示一个例子,Brian,在你像迈克尔那样觉得困惑之前。

So let me show you an example, Brian, before you're like, I don't know, Michael.

Speaker 0

这听起来很奇怪。

This sounds weird.

Speaker 0

确实听起来很奇怪。

It does sound weird.

Speaker 0

但很酷。

It's cool.

Speaker 0

来看看这个。

So check this out.

Speaker 0

让我来演示一下,我链接了这些例子,地址是 .pyview.rocks。

Let's I'll you I linked to this these examples examples .pyview.rocks.

Speaker 0

有很多例子,但这里有一个地图示例。

There's a bunch of but there's a maps example.

Speaker 0

明白吗?

Okay?

Speaker 0

我会先给你看这个例子,然后展示代码,我想听听你的反应。

I'm gonna show you the example, then I'm gonna show you the code, and I want your reaction.

Speaker 0

明白吗?

Okay?

Speaker 0

我会为听众做解说。

And I'll I'll narrate for listeners.

Speaker 0

如果我放大一点,左边是一份美国国家公园的列表。

So if I zoom out, what we have is on the left, we've got a list of US national parks.

Speaker 0

右边是一个 OpenStreetMap 地图。

And on the right, we have a OpenStreetMap map.

展开剩余字幕(还有 426 条)
Speaker 0

对吧?

Right?

Speaker 0

所以你看到左边,选中的国家公园已经被选中了。

So you see on the left, it has the selected park selected.

Speaker 0

如果我在地图上点击其中一个,左边的内容就会更新,显示就是这个。

And if I click on one over here in the map, it then updates the thing on the left, right, to say like, that was it.

Speaker 0

这是一个加载在这里的 JavaScript 地图组件。

This is a JavaScript map component that's loaded here.

Speaker 0

当你与它交互时,你可以看到详情视图,或者说是列表视图——哦,不。

And as you interact with it, you can see the the details view or the list view rather oh, no.

Speaker 0

我把窗口弄丢了。

I lost my window.

Speaker 0

正在更新。

Is updating.

Speaker 0

对吧?

Right?

Speaker 0

它们保持同步。

They're staying in sync.

Speaker 1

这很酷。

That's cool.

Speaker 0

这很酷。

That's cool.

Speaker 0

现在,当我点击左侧时,地图也会移动。

Now also when I click on the left, it moves the map.

Speaker 0

所以如果我点击黄石公园,地图就会跳到那里。

So if I click on Yellowstone, the map jumps over there.

Speaker 0

如果我点击约书亚树,它就会出现在那里。

If I click the Joshua Tree, it's over there.

Speaker 0

如果我选择一个更近的地方,比如奥林匹克国家公园或国家森林,它就会弹出来。

If I bring something closer to home, like a lunch Olympic National Park, the National Forest, that pops up.

Speaker 0

这是一个相当不错的应用,它显然是交互式的,没有刷新页面,虽然看起来有点复杂,但如果我回到这里,打开地图并给你看代码,我来为大家解释一下:有一个CSS文件,没问题;还有一个parks.py文件,它本质上就是一个包含字典的列表,里面是公园的名字、纬度、描述和图标,就是一个简单的扁平数据文件,是的。

This is a pretty neat app, and it it's clearly interactive, it's not refreshing the page, feels complicated, but if I go back here and I go to the maps and I show you the code, I'll describe this for everyone, there's a CSS file, that's fine, there's a hold on, let's see this way, there's a parks py file and it literally is just a list of dictionaries of like here's the name of the parks, here's the latitude, here's the description, here's the icon, it's just like a flat data data file yeah.

Speaker 0

返回,地图。

Go back, the map.

Speaker 0

Py 文件显示我们要创建一个数据类,这个数据类包含一个公园列表和一个选中的公园。

Py it says we're going create a data class The data class has a list of parks and a selected park.

Speaker 0

当有人点击时,它会使用字典推导式之类的方式搜索匹配的公园。

When somebody clicks on it, it just does a dictionary comprehension or sort of thing to search for the park that matches.

Speaker 0

它会在数据类中设置选中的公园名称,并触发一个高亮公园的事件。

It sets the selected park name on its data class, and it says there's an event to highlight the park.

Speaker 0

这就是整个应用程序。

That's the entire application.

Speaker 1

这太惊人了,

That's pretty amazing,

Speaker 0

真的。

actually.

Speaker 0

这不疯狂吗?

Is that nuts?

Speaker 0

对吧?

Right?

Speaker 0

如果你看一下HTML,它就是一堆Jinja模板加上Tailwind,只是说绑定到这个值。

And if you look at the HTML, it's just a bunch of Jinja with Tailwind that just says, you know, bind to this value.

Speaker 0

不是简单地写value等于,而是写phoenix value等于,然后从名称中提取上下文。

Instead of just saying the value equals, you say phoenix value equals and you just pull out the context from the name.

Speaker 0

这是一个非常有趣的Web框架,但目前还没有得到太多关注。

So this is a super interesting web framework that has not got a lot of light shined on it yet.

Speaker 0

它只有63个星标。

It's got 63 stars.

Speaker 0

所以它基本上是Phoenix Live View的重新实现。

So it's basically a reimplementation of the Phoenix Live View.

Speaker 0

而且我觉得它相当不错。

And yeah, think it's pretty neat.

Speaker 0

拉里说他一直在工作中用它做项目,现在刚开始向公众推广。

Larry says he'd been using it for some projects at work and just starting to get it out in the public.

Speaker 0

所以它实际上可能比感觉上更经过测试。

So it's probably more tested than it feels.

Speaker 0

最后,如果你想了解,我会在节目笔记中提供这个链接。

And finally, if you want to understand I'll link to this in the show notes.

Speaker 0

如果你想了解这到底是如何实现的?

If you want to understand like like how is this even possible?

Speaker 0

你需要阅读文档中的‘Live View 生命周期’部分,它会解释:首先它是如何渲染模板的,然后在完成后建立 WebSocket 连接,接着监听事件,再是差异引擎,以及所有这些内容,还有实时事件和实时更新是如何发生的等等。

You need to read the Live View Life Cycle section of the docs, and it talks about, okay, how it first renders the template, and then once it's done that, it's connected a web socket, then it listens for events, and then the diffing engine, and all that kind of stuff, and how real time events, real time updates happen, and so on.

Speaker 0

总之,你觉得怎么样?

Anyway, what do you think?

Speaker 0

很酷,对吧?

Neat, right?

Speaker 1

我觉得这相当酷。

I think it's pretty cool.

Speaker 1

是的。

Yeah.

Speaker 1

是的。

Yeah.

Speaker 0

对。

Yeah.

Speaker 0

不错。

Cool.

Speaker 0

好吧,就这样了。

Well, that is that.

Speaker 0

我觉得我们聊得差不多了。

I think we're out of topics.

Speaker 0

是的。

Yeah.

Speaker 0

还有什么补充的吗?

Any any extras?

Speaker 1

是的。

Yeah.

Speaker 1

我有几个额外的内容。

I got a couple extras.

Speaker 0

好的。

Alright.

Speaker 0

我们把时间交给你,看看你有哪些额外的内容。

Let's throw it throw it over to you to check out the extras you got.

Speaker 1

好的。

Okay.

Speaker 1

所以我们确实做了。

So we did.

Speaker 1

我刚才在聊我之前提到的那篇文章,是关于Django管理命令的,出自Revsys博客,而Revsys还有另一个很酷的东西我想展示一下。

I I was just talking about the article I brought talked about earlier about the Django management commands that was that was on the revsys blog, and there's another cool thing that revsys has that I want to show.

Speaker 1

首先,我确定我们已经宣布过了,但Django 6是在12月3日发布的,随后在1月6日发布了bug修复版本6.0.1。

So first off, we did I'm pretty sure we announced this, but Django six was released on December 3 and there was a bug fix six zero one, which came out on January 6.

Speaker 1

哦,我的生日。

Oh, my birthday.

Speaker 1

他们送了我一份生日礼物。

They gave me a birthday present.

Speaker 1

但你应该升级吗?怎么升级呢?

Then but so should you upgrade and and how to upgrade?

Speaker 1

我想谈的是,有一个叫 upgradedjango.com 的网站,这是 RevSys 出的,挺不错的。

And that's what I want to talk about is there's a there's a website called upgradedjango.com, and this is put out by RevSys, and it's pretty cool.

Speaker 1

它列出了所有的 LTS 版本,以及当前受支持的 Django 版本。

It has it has all the has the the LTS versions, and it has basically the current supported version of Django.

Speaker 1

我们有最新版本、初始发布日期和停止支持的日期。

We've got latest version and initial release end of support dates.

Speaker 1

此外,他们还列出了未来计划发布的版本。

Then they have future versions scheduled so far.

Speaker 1

目前只计划了 6.1 版本,定于八月发布,还有一大堆已停止支持的旧版本。

There's only 6.1 planned so far in August, and then a whole bunch of old unsupported releases.

Speaker 1

如果你正在使用一个已停止支持的版本,那你很可能应该升级了。

Now, if you're on an unsupported version, you probably ought to upgrade.

Speaker 1

但你要怎么做呢?

But how do you do that?

Speaker 1

我喜欢的一点是,他们有一个关于如何升级的章节,也讲了如何升级。

And that's one of the things I like is the they have a a section on wide upgrade and they also how to upgrade.

Speaker 1

我其实没料到这一点。

And I actually was not expecting this.

Speaker 1

他们的建议是,除非你真的了解所有Django版本的内容,否则最好逐版本升级。

Their recommendation is unless you really know what's in all the Django releases, you probably had to do it version by version.

Speaker 1

幸运的是,通常每年只会发布一两个大版本,所以你不太可能落后太多。

Luckily, there's usually just one or two big versions that come out a year, So you're probably not behind too much.

Speaker 1

但讨论的问题是:应该一次升级一个版本、几个版本,还是直接跳到最新版本。

But but so the discuss is doing it one release at a time or a few at a time or just jumping all the way.

Speaker 1

当然,他们也提到,你可以花钱请人来做,比如我们,这挺不错的。

And then of course, you know, it's it's from roses and it's fine that they say you could pay somebody to it like maybe us, which is cool.

Speaker 1

但我喜欢的是围绕这个话题的讨论。

But I do like I like the the discussion around it.

Speaker 1

关于逐个版本升级的讨论。

The the the discussion about going one release at a time.

Speaker 1

如果你真的能根据发行说明了解有哪些变化,就可以尝试运行它并运行你的测试套件,看看是否一切正常。

If you if you really you can go by the release notes then of like what changed and you could just, try to run it and run your test suite and see if everything's working.

Speaker 1

如果不行,就可以查看发行说明来找出原因。

And if it's not, then you can check the release notes to figure out why.

Speaker 1

这可能是较慢的方式,但也没那么糟糕。

And it might be the slower way to do it, but it might not be that bad.

Speaker 1

你或许可以花一天左右的时间慢慢搞定。

You could just sort of chug through it in a day or so, maybe.

Speaker 1

我不确定。

I don't know.

Speaker 1

这取决于你使用了多少被更改的功能。

Depends on how many of the features you're using that have been changed.

Speaker 1

是的。

So Yep.

Speaker 1

是的

Yep.

Speaker 1

这很棒。

That's cool.

Speaker 0

你甚至可以直接说,嘿,Claude。

You you might even be able to say, hey, Claude.

Speaker 0

我目前用的是这个版本的Django。

I'm on this version of Django.

Speaker 0

我想升级到那个版本。

I wanna be on that version.

Speaker 0

这是发布说明。

Here's the release notes.

Speaker 0

帮帮忙。

Help.

Speaker 1

对。

Yeah.

Speaker 1

是的。

Yeah.

Speaker 1

而且,你甚至可以告诉它这些内容,你知道的,我运行我的测试,逐个升级

And also, could even tell it's this this stuff, you know, I run my tests, bump

Speaker 0

一个版本

up one

Speaker 1

一次升级一个版本,然后运行测试。

version at a time, run the tests.

Speaker 0

阅读这份指南,画个草图,我们一起来弄清楚。

Read read this guide, sketch it out, and let's let's figure out.

Speaker 0

是的。

Yeah.

Speaker 0

我认为在我们离开这个话题之前,布莱恩,快速说一下,是的。

It's I think it's more important before we move off this topic, Brian, really quickly Yeah.

Speaker 0

升级Django的重要性,可能比一些人意识到的还要高。

Is it's more important than perhaps some people realize to upgrade Django.

Speaker 0

Django 比大多数 Python 网络框架功能更多。

Django does much more than most Python web frameworks.

Speaker 0

对吧?

Right?

Speaker 0

它自带管理后台和各种功能,时不时就会出现一些关于 x、y 和 z 的安全问题,我们需要修复。

It's got admin sections and all sorts of things, and every now and then there's like there's some kind of security issue we should fix around x y and z.

Speaker 0

是的。

Yeah.

Speaker 0

在 Flask 中你很少看到这种情况。

Don't see that as much as Flask.

Speaker 0

你在 Flask 或 FastAPI 中看不到这些问题,因为那些安全漏洞是你自己添加功能时引入的。

You don't see it was Flask or FastAPI because the security problems are the one you write adding those features to your app yourself.

Speaker 0

这些功能本身不会有 CVE 漏洞,对吧。

There's no CVEs for those, right.

Speaker 0

但因为 Django 自带了所有这些功能,攻击面更大,所以你有时需要及时跟进更新。

But because Django comes with all that functionality, there's more of a surface area and sometimes you want to be on top of it.

Speaker 0

所以别轻视它。

So don't sleep on it.

Speaker 0

保持领先。

Stay ahead.

Speaker 1

这也是选择Django的另一个原因,因为使用它的人很多,安全补丁能很快得到修复。

That's also another reason to choose Django as well because you because it's used by so many people, the security fixes get fixed pretty fast.

Speaker 0

是的。

Yeah.

Speaker 0

你的那个独立网页应用接受安全测试的方式可不怎么愉快。

The way your your one off web app gets security tested is not fun.

Speaker 1

对。

Yeah.

Speaker 1

对。

Yeah.

Speaker 1

还有性能,以及跟上新版本。

Also performance and yeah, just keeping up with newer versions.

Speaker 1

是的。

Yeah.

Speaker 1

很好的理由。

Good reasons.

Speaker 1

接下来,我想谈谈这本书。

Next up, I wanted to talk about the book.

Speaker 1

上星期一录制的,星期二我就想,我只想尽快完成第一个版本。

Recorded last Monday and on Tuesday I was like, I just want to get the first release done.

Speaker 1

所以周一晚上我花了很多时间专心写作,终于完成了第一版。

So I just I spent a lot of time Monday night just just writing and finished up the the first edition.

Speaker 1

而且已经有好几次下载了。

And I there's there's a bunch of downloads.

Speaker 1

一共有六次,因为有人问过我这件事。

There's six because I've had people ask about it.

Speaker 1

这确实是完整的书。

There's there's really the full book.

Speaker 1

然后第二部分和第三部分是单独下载的。

And then there's part two and part three are individual downloads.

Speaker 1

你已经读过一部分了,我想我们现在有多少章来着?

You've already read part of it anyway, I think there's what do we got?

Speaker 1

现在有17章左右,但我正在。

17 chapters or something like that now, but I am.

Speaker 1

所以我现在在做的,是逐章润色它。

So now what I'm doing, what am I doing now is I'm going through and and cleaning it up.

Speaker 1

有一些人给我的GitHub页面提交了问题,这很棒。

There's some people that have submitted issues to the my GitHub page, which is cool.

Speaker 1

一些值得考虑的事情。

Some things to think about.

Speaker 1

所以我正在查看反馈,但数量不多。

So I'm I'm looking at feedback, but there's not that many.

Speaker 1

所以我觉得第二版应该能很快完善。

So I think I might get the second edition pretty good quickly.

Speaker 1

然后我会再通读一遍,进行第三版的修订——不是添加内容,而是第三次通读,也就是第三稿。

And then I'm going to go through and read it all and do the third edition or the third, not additions third, I guess, through the the third pass through it, the third draft by reading it.

Speaker 1

这就是我的流程。

So that's my process.

Speaker 1

我还把它发布在 pythontest.com 上,但现在你也可以在 leanpub.com 上获取。

I also put it up for it's it's available on pythontest.com, but you can also get it at leanpub.com now.

Speaker 1

我已经在那儿上架了。

I made it available there.

Speaker 1

而且,我觉得目前为止还没人通过 Leanpub 购买过。

And and I haven't I don't think I've gotten anybody buy it from Leanpub yet.

Speaker 1

所以,是的,你可以看到它有一个很酷的‘自定价格’滑块。

So, yeah, you can you can it's it's got, like, the cool set your own price slider.

Speaker 0

是的。

Yeah.

Speaker 0

这个用户界面很有趣。

The UI is fun.

Speaker 0

是的

Yeah.

Speaker 0

喜欢。

Like it.

Speaker 1

所以这些就是我的补充内容。

So that's those are my extras.

Speaker 1

所以

So

Speaker 0

太棒了。

Sweet.

Speaker 0

好的。

Alright.

Speaker 0

我其实有几个。

I have a few actually.

Speaker 0

《The New Stack》上有一篇不错的文章。

Nice article over at the New Stack.

Speaker 0

他们写了一篇长文,报道了我最近参与的一期播客节目,主题是《Python:2026年将有哪些新变化》。

They wrote up a a long article on a recent podcast episode I did called Python, what's coming in 2026.

Speaker 0

所以我做了一期很棒的节目,和一群人士讨论了Python的未来走向,包括三位核心开发者、学生委员会成员、其他名人和教授等等。

So I did a nice episode of, you know, where are we where are we going with Python, with a bunch of folks, three core developers, student council members, other celebrities, and professors, and so on.

Speaker 0

他们写了这篇文章,我觉得写得非常好。

And so they wrote this up, and it's just I thought it was really nice.

Speaker 0

他们真的整理得很到位,比如这里引用了布雷特·卡农的说法。

Like, they really put together a like, here's here's what Brett Cannon said.

Speaker 0

这里是巴里·华沙或托马斯·韦瑟斯的原话,还有朱迪·伯奇伯尔等等。

Here's what Barry Warsaw or Thomas Werthers wrote, Judy Birch Birchall, and so on.

Speaker 0

真的很棒,大家可以去看看。

So really nice, and people can check that out.

Speaker 0

所以我打算把这篇文章的链接放上来。

So I'm just gonna link to that.

Speaker 0

就这样吧。

Go it this way.

Speaker 0

所以,布莱恩,你根本不知道这件事。

So Brian, you didn't even know this.

Speaker 0

这件事发生了,但据我所知,它并没有造成问题,这简直不可思议。

This happened, and to my knowledge, it is not a problem, which is miraculous.

Speaker 0

我上周末彻底重写了 Python Bytes。

I completely rewrote Python bytes over the weekend.

Speaker 0

它原本是用 Pyramid 框架写的,全部是同步代码,我按照我之前把 Talk Python 改造成 CORT 的方式,把它全部改成了异步的 Flask,把所有的数据库查询和 API 调用都转成了异步的。

It was in Pyramid and using all synchronous code, and I rewrote it in the same way that I did talk Python into CORT, which is async flask, and converted it all to async database queries and API calls and stuff like that.

Speaker 1

不错。

Nice.

Speaker 0

你猜怎么着?

And guess what?

Speaker 0

它似乎仍然正常运行。

It seems seems to still be working.

Speaker 0

太棒了。

Hooray.

Speaker 0

这么大的改动让我很紧张。

Big changes like that make me nervous.

Speaker 0

我的意思是,这相当于换了五千行代码。

I mean, it was like 5,000 lines of code exchange.

Speaker 0

但不管怎样,这真的

But anyway, that's really

Speaker 1

那原因是什么?

So what was the reason?

Speaker 1

只是为了让它更快吗?

Is it with just to try to get it faster?

Speaker 1

或者

Or

Speaker 0

不是。

No.

Speaker 0

不是。

No.

Speaker 0

这不是性能问题。

It's not a performance thing.

Speaker 0

我最近构建的所有东西,都是用 Court 或 FastAPI,一些支持类型且实际在使用的异步框架。

It's a everything that I'm building these days, I'm building in court or fast API, some async framework that supports types and that is actually being used.

Speaker 0

如果你读过我常推荐的 TalkBython 那篇博客文章,基本上就是这个原因。

And if you read this blog post that I like to for TalkBython, basically that was why.

Speaker 0

我不希望它只是停留在一个四年没发布过新版本、越来越老的框架上。

Like, I don't I don't want it just hanging around on a framework that hasn't had a release in like four years and just getting older.

Speaker 0

你明白我的意思吗?

You know what I mean?

Speaker 0

因为万一它出了什么问题怎么办?

Because what if something does come up with it?

Speaker 0

他们说,哦,有个安全漏洞。

They say, oh, there's a security vulnerability.

Speaker 0

你觉得这种问题能被多快修复呢?

Well, how how well do you think that's gonna get fixed?

Speaker 0

你明白我的意思吧?

You know what I mean?

Speaker 0

也许吧,也许不是。

Maybe, but maybe not.

Speaker 0

对吧?

Right?

Speaker 0

看到那些老旧但还没被弃用的代码——‘弃用’这个词有点太重了,但其实就是不再维护的代码,这让我很不安。

It just makes me nervous to to have like old not abandoned, it's a bit of a harsh word, but basically no longer maintained code.

Speaker 0

所以周六那天我正坐在那儿,突然觉得,哇,它就这么搁在沙发上不管了。

And so I was just sitting there on Saturday and like, woah, it's kinda hanging out here on the couch.

Speaker 0

我能做点什么?

What can I do?

Speaker 0

让我看看,我只剩几个应用要迁移到更现代的框架了,所以我想试试看,结果还挺顺利的,就这样了。

Let me see if I can just I only have a few more apps to move over to something more modern, so I thought I'd give it a go, it went pretty well, so there it is.

Speaker 1

如果你不用操心那么多不同的框架,心理负担也会轻不少。

It's eases up on your mental load too if you don't have to think about lots of different frameworks.

Speaker 0

没错。

Exactly.

Speaker 0

如果我写了一个小巧的库,能在其中一个上运行,我会想,哦,这个其实可以用于所有这些地方。

If I write some cool little library that works on one, I'm like, oh, that would actually be cool to use in all these things.

Speaker 0

如果我想添加新功能什么的,我会想,好。

If I wanna add a new feature or something, I'm like, yeah.

Speaker 0

但情况并不一样。

But it's not the same.

Speaker 0

你明白我的意思吗?

You know what I mean?

Speaker 0

就是完全如此。

Just it is exactly.

Speaker 0

能基本保持一致也很不错。

It's nice to have it basically the same as well.

Speaker 1

比如,一旦我搞懂了PyTest,我就想,我是不是还该去学精通单元测试?

Like, once once I kinda had my head around PyTest, I was like, should I go try to become an expert at unit test also?

Speaker 1

不。

Nah.

Speaker 1

我不想去。

I don't want to.

Speaker 0

是的。

Yeah.

Speaker 0

我的意思是,对应的场景是,你有两千个单元测试,你本以为因为有 fixture,用 PyTest 实现这个功能应该简单得多,但其实并没有。

I mean, the equivalent equivalent would be like, you've got, you know, 2,000 tests in unit tests, and you'd you'd like, it should be so much easier to do this feature in PyTest because fixtures, but it's not.

Speaker 0

对吧?

Right?

Speaker 0

你不需要重写它。

Like, you don't have to rewrite it.

Speaker 0

它并不会让运行速度提升多少,但如果你还要继续维护并添加功能,你会觉得,我宁愿不要去写一个本质上已经定型的东西。

It's not like it would make it run that much better, but if you're gonna continue to work on it and add features, you're like, I would rather not write against a thing that is kind of done in a nutshell.

Speaker 1

事实上,这正是我也会让 Claude 帮我分析的一点,它会说:是的。

Well, that's one, Actually, that's one of the things I would totally throw Claude at too to be able to say Yeah.

Speaker 1

你知道的,就重写这些吧。

You know, just rewrite these.

Speaker 1

没错。

Exactly.

Speaker 1

我已经有了这些逻辑。

I've already got the logic there.

Speaker 1

我只是想要不一样的。

I just want it different.

Speaker 0

是的。

Yeah.

Speaker 0

我就是这么做的。

That's what I did.

Speaker 0

我重写 TalkPython 的时候是手工完成的,我还写过这篇文章,花了好几个星期。

The rewriting TalkPython, I did it by hand, and I wrote about it, and it took weeks.

Speaker 0

所以我做的是,把 TalkPython 和 PythonBytes 两个项目都加载进来,然后说:来完成这个转换吧。

So what I did is I loaded a project with both TalkPython and PythonBytes, and I said, want to do this transformation.

Speaker 0

这是Quart的文档,这是TalkPython,它的代码库非常相似,已经迁移过来了。

Here's the docs for Quart, and here's TalkPython, which is a very similar code base that has been migrated over.

Speaker 0

所以每当你遇到问题时,看看我们在那边是怎么处理的,效果不错。

So anytime you see an issue, see how we handle it over there, and it it went well.

Speaker 1

哦,天哪。

Oh, wow.

Speaker 1

是的。

Yeah.

Speaker 1

这个不错。

That's a good one.

Speaker 0

是的。

Yeah.

Speaker 0

很好。

Cool.

Speaker 0

所以,希望我们以后再也不提这件事了,因为如果我再提,那可能意味着出了什么问题。

So anyway, hopefully, we never speak of that again because if I do, that probably means something broke.

Speaker 0

好的。

Alright.

Speaker 0

上周末我做的另一件事是为TalkPython创建了一个MCP服务器。

Another thing I did over the weekend is I created an MCP server for TalkPython.

Speaker 0

也许我也会为Python Bytes做同样的事情,如果大家需要的话。

And maybe I'll do this for Python bytes that people want as well.

Speaker 0

所以我们刚刚谈到了Tailwind。

So we I mean, we just talked about Tailwind.

Speaker 0

对吧?

Right?

Speaker 0

而让AI更适用于你的应用或项目的理念,就像在Tailwind末期发生的种种事情中点燃的那根火柴。

And how the basically, the concept of making AIs more friendly for your app or your project was the match that got struck within the Tinder box of what was going on at tail end.

Speaker 0

对吧?

Right?

Speaker 0

所以这可以说是完全相反的。

So this is kind of the opposite.

Speaker 0

我就想,嘿。

I'm like, hey.

Speaker 0

让我们让那些询问TalkPython相关问题的人更容易获得准确的答案,而不是被误导的虚假信息或过时的播客内容。

Let's make it easier for people who are asking questions about TalkBython to get good answers, not hallucinated junk answers or out of date answers about our podcast.

Speaker 0

对吧?

Right?

Speaker 0

人们已经在问了,嘿,查德,跟我讲讲关于TalkPython的这个内容,或者直接问一些关于Python的问题。

People are already asking, hey, Chad, tell me about this for TalkPython, or they'll just ask a question about Python.

Speaker 0

它会给他们推荐一集节目并介绍相关内容。

It'll it'll give them an episode and tell them about it.

Speaker 0

对吧?

Right?

Speaker 0

所以,这使得AI能够在提问时访问实时信息,而不是仅依赖训练时的数据。

So what this does is it lets AIs access fast real time information at the time of asking, not at the time of training.

Speaker 0

对吧?

Right?

Speaker 0

这真的很酷。

So that's really cool.

Speaker 0

所以你可以这么说,比如,最近的,你知道的,我甚至查了一下。

So you can say like, well, what are the last you know, I even check this out.

Speaker 0

我在Claude上做过这个。

I did this on Claude.

Speaker 0

嘿,我有个问题。

Hey, I have a question.

Speaker 0

TalkPython的最近五期节目是什么?

What are the last five episodes on TalkPython?

Speaker 0

让我用TalkPython的MCP服务器来进行这个检索。

Let me use TalkPython's MCP server for this retrieval.

Speaker 0

获取最新节目。

Getting recent episodes.

Speaker 0

搞定。

Boom.

Speaker 0

在这里。

Here they are.

Speaker 0

磁盘缓存,1月12日。

Disc cache, January 12.

Speaker 0

Web框架及其创作者的生产实践,1月5日。

Web frameworks and prod by their creators, January 5.

Speaker 0

你正在审核中。

You're in review.

Speaker 0

这是他们刚写的文章,就是那篇他们写的文章。

This is the article they just wrote up, the one they wrote up.

Speaker 0

而且如果我发布了一个新剧集,等十秒钟再问这个问题,它会在十秒后把这个新剧集加进去。

And it's that if I publish a new episode, wait ten seconds and ask this question again, it will put that episode in there ten seconds later.

Speaker 1

所以你需要确认一下,对吧?

So do you have to okay.

Speaker 1

也许我漏听了,你之前说过这个。

So maybe I missed this and you said it.

Speaker 1

你一旦搭建了一个MCP服务器,是不是还得在某个地方注册一下?

Do you have to, like once you do an MCP server, do you have to, like, register it somewhere,

Speaker 0

或者我得去哪找一个合适的地方呢?我实在想不出来。

or do you have I to I can't figure out a great place.

Speaker 0

所以我做了一个叫MCP的页面,上面写着:如果你想要集成这个,LLM会读取这个内容,对吧?

So what I've done is I have a page up here called MCP that says, hey, if you want to integrate this, and LLMs will read this, right?

Speaker 0

我做了两件事,比如,这里有完整的文档说明它是如何工作的,等等。

There's two things I've done, like, so there's a full documentation on how this works, right, and so on.

Speaker 0

这些内容是给LLM,也就是AI代理阅读和使用的。

And that's for the LLM, you know, the the AI agents to read and use.

Speaker 0

你可以把这个URL——thunder.fm/api/mcp——复制到Claude、Code Cursor和其他地方使用。

You can then take that, take this URL here, talk by Thunder dot f m slash API slash m c p and put that in Claude Claude code, cursor, and other places.

Speaker 0

但ChatGPT无法与它配合使用。

But ChatGPT won't work with it.

Speaker 0

我不知道为什么。

I don't know why.

Speaker 0

它们就是不行。

It's they just don't.

Speaker 0

这真的很奇怪。

It's it's really weird.

Speaker 0

我可以稍后跟进一下这件事。

I I can follow-up on that later.

Speaker 1

因为用户可能会说,嘿。

Because So like a user could say, hey.

Speaker 1

你看这个。

You know, look at this.

Speaker 0

是的。

And Yes.

Speaker 0

没错。

Exactly.

Speaker 0

然后我做的另一件事,等等,让我想想。

And then the other thing I did relate well, hold on.

Speaker 0

让我在我们还在MCP这边的时候,再给你快速展示一个东西。

Let me just show you one more thing really quick while we're on the MCP side.

Speaker 0

所以你可以提出更复杂的问题,比如我们稍微放大一点。

So you can ask more complicated questions like let's zoom out a little.

Speaker 0

塞巴斯蒂安·拉米雷斯出演了哪些集数?其中最新的是哪一集?

Which episodes did Sebastian Ramirez appear on and which was the latest?

Speaker 0

你可以看到,Claude会使用MCP来搜索嘉宾,然后找到了塞巴斯蒂安,这位嘉宾告诉他有哪些集数。

You can see it's like, oh, Claude goes and uses the MCP to search for guests, then it found Sebastian, and that guest tells him what episodes are on.

Speaker 0

接着它根据找到的集数ID进一步搜索这些集数的详情。

So then it searched for the episodes based on the IDs of the episodes that found.

Speaker 0

这太棒了。

It's great.

Speaker 0

我找到了,让我获取所有集数的详细信息。

I found here's let me get all the episode details.

Speaker 0

好的。

Okay.

Speaker 0

我找到了,这里显示塞巴斯蒂安·拉米雷斯出演了《Talk Python to Me》的五集节目,并列出了所有五集及其日期。

I found this, and it goes here and says, here, Sebastian Ramirez appeared on five episodes of Talk Python to me, and it lists out all five of them and their dates.

Speaker 0

最近的一集是几周前,他加入节目讨论了Django、Flask、Quart、Lightstar和FastAPI等话题。

The most recent one was just a couple weeks ago where he joined to talk about Django, Flask, QuartLightstar, and FastAPI, and so on.

Speaker 0

这不是很酷吗?

Ain't that cool?

Speaker 1

这确实很酷。

That is cool.

Speaker 1

我觉得,实际上,嘉宾们可能会用这个功能来查:我什么时候上过《TalkBlyst》?

I think, actually, peep guests might use this to say, like, when was I on TalkBlyst?

Speaker 0

是的。

Yeah.

Speaker 0

实际上,有一件事简直太疯狂了。

Actually, one of one of the like, this is crazy.

Speaker 0

很久以前的一位嘉宾,大概八年前的塞尔吉奥,当我在一个社交媒体上宣布这个功能时,他说:我只是问了一下,塞尔吉奥说了什么?

One of the long ago guest from, like, eight years ago, Sergio, when I announced this on one of the social media, he said, I just asked, like, what did Sergio say?

Speaker 0

你知道的,把他的全名写上。

You know, put his whole name.

Speaker 0

塞吉奥说了什么?

What did Sergio say?

Speaker 0

它实际上写道,他出现在这一集中。

And it actually said, he appeared on this episode.

Speaker 0

这是他做的,你懂的,他调出了字幕并进行了分析,说:这是他说的内容,这也是他出场时的主要观点等等。

Here's what he you know, pulled up the transcripts and analyzed and said, here's what he said, and this was his main thesis of his appearance and so on.

Speaker 0

我心想,天哪。

I'm like, jeez.

Speaker 0

所以这还挺酷的。

So it's it's pretty cool.

Speaker 0

所以你问,如果你的AI没有MCP支持,该怎么办?

So you asked like, well, if you don't have an MCP support for your AI, what do you do?

Speaker 0

好吧,我做的另一件事是添加了一个叫llms.txt的东西,这是杰里米·霍华德提出的点子,他来自Fast AI、Fastmail,还有其他很多项目,我想还有Fast HTML。

Well, this other thing I did is I added something called llms.txt, is a idea by Jeremy Howard of Fast AI, Fastmail, many other things, I think also Fast HTML.

Speaker 0

总之,他做了很多东西。

Anyway, bunch of stuff he's doing.

Speaker 0

这个想法有点像robots.txt,是一个用来存放信息的地方。

And the idea is it's kind of like robots.txt, it's a place where you put stuff.

Speaker 0

我想我只需要在这里加载它。

I think I just load it up here.

Speaker 0

我不用手动输入。

I don't have to type.

Speaker 0

它就像robots.txt,但专门用来描述LLM应该如何操作。

It's like a robots.txt, but it's there for to describe what to do for LLMs.

Speaker 0

所以它会提供一些背景信息等等。

So it gives you a little bit of background information and so on.

Speaker 0

它说明了,即使你没有注册,只要系统知道去查找这个文件,就可以使用我们的LLM API或MCP服务器。

It says, actually, here's how you can use our LLM API or MCP server even if you didn't register it, long as the the thing knows to look for this.

Speaker 0

所以我很快就要写一篇关于这一切的博客文章。

So I'm actually writing a blog post about all this soon.

Speaker 0

很酷。

Cool.

Speaker 0

对。

Yeah.

Speaker 0

很疯狂,对吧?

Pretty wild, right?

Speaker 0

对。

Yeah.

Speaker 0

我觉得这对《Python Bytes》会很不错。

Think it'd be nice for Python bytes.

Speaker 0

而且很快,我可能还会回到这个话题,我知道现在说得有点长了。

And also really quickly, probably come back to this, and I know this is going long.

Speaker 0

很多人强烈反对,说想阻止AI获取我的内容,因为AI只是在窃取我的版权内容。

There's a lot of there's a lot of pushback to say, wanna block AI from getting my content because AI is just stealing my copyrighted content.

Speaker 0

我对这种感受非常理解。

And I have a lot of sympathy for that feeling.

Speaker 0

是的。

Yeah.

Speaker 0

但如果你并不打算完全屏蔽它,那么你最好尽可能优化AI的体验。

But if you are not going so far as to block it, you probably should make the AI experience as good as possible.

Speaker 0

对吧?

Right?

Speaker 0

与其在我问塞巴斯蒂安那期节目讲了什么时,它回答说‘我的训练数据只到2025年夏天’,

Rather than having when I asked what was that episode about Sebastian, if it could have said, well, my training data goes back to summer twenty twenty five.

Speaker 0

所以从这些信息中,我知道,比如一年前他上过节目之类的,

So from that information, I have, you know, like, a year ago, he was on the show or something.

Speaker 0

对吧?

Right?

Speaker 0

而不是提供最新的信息。

Rather than up to the minute information.

Speaker 0

所以你要么完全屏蔽,要么就尽量把它做得尽可能好。

So either you block it completely or try to make it as good as possible.

Speaker 0

而且我完全没有屏蔽的打算。

And I'm I have no intention of blocking.

Speaker 0

我觉得这些可能就是五年后的新型搜索引擎,我担心如果屏蔽了,你就彻底消失了。

I feel like these might be the new search engines of five years in the future, and I'm concerned that if you block it, you will just vanish.

Speaker 0

你明白我的意思吗?

You know what I mean?

Speaker 0

所以尽量把它做得尽可能好。

So make it as good as possible.

Speaker 0

这就是我的想法,也是我为什么把那些东西放在这里的原因。

That's that's my thinking, and that's why I put those there.

Speaker 1

我觉得无论是完全屏蔽、完全不屏蔽,还是中间态,都有其合理的立场。

I think there's I think there's valid choices on both ends of it, and and even in the middle of just, like, not doing anything.

Speaker 0

是的。

Yeah.

Speaker 0

是的。

Yeah.

Speaker 0

你不必做任何事。

You don't have to do anything.

Speaker 0

但我的意思是,如果你在乎有人来发现它的话。

But I mean, if you care about getting people coming and finding it.

Speaker 0

对吧?

Right?

Speaker 0

是的。

Yeah.

Speaker 0

我确实认为说‘我不想要它’是一个合理的观点。

I I do think it's a valid point to say, I don't want it.

Speaker 0

我会屏蔽所有AI。

I'm gonna block all the AIs.

Speaker 0

我只是觉得,对于这种需要广为人知的事情,这样做就结束了。

I just think that is it for something that needs to be publicly well known.

Speaker 0

这将是一个有风险的赌注。

It's going to be a risky bet.

Speaker 1

是的。

Yeah.

Speaker 1

我能看到这两方面的观点。

I I I see the both sides of it.

Speaker 1

我同意。

I agree

Speaker 0

跟你一样。

with you.

Speaker 0

是的。

Yeah.

Speaker 0

是的。

Yeah.

Speaker 0

所以,我的意思是,作为创作者,像内容创作者、作家等等,我们正处于一个艰难的境地。

So I mean, you're we as creators and people like content creators, writers, etcetera, it's a tough place to be.

Speaker 0

对吧?

Right?

Speaker 0

但我认为,即使这会减少人们访问我们的内容,也不应该隐身不见。

But my my bet is that it's it's better to not be invisible even if it's detracting from people visiting our content.

Speaker 0

是的。

Yeah.

Speaker 0

如果别人选择不同的做法,我不会说他们错了。

I'm not gonna say someone else is wrong if they choose otherwise.

Speaker 0

好的。

Alright.

Speaker 0

我们来看看。

Let's see.

Speaker 0

因为这段太长了,我会跳过最后一个。

Just because it's long, I'm gonna skip that last one.

Speaker 0

我们直接看笑话吧。

Let's just go straight to the joke.

Speaker 0

怎么样?

How about that?

Speaker 1

是的。

Yeah.

Speaker 1

我可以适当加点幽默。

I could I could let use some levity.

Speaker 1

是的。

Yeah.

Speaker 0

我觉得这对我们刚才聊的AI话题是个很好的延伸。

And I think this is a good follow-up for this AI thing we just talked about.

Speaker 0

天啊。

So god.

Speaker 0

是在领英上。

It's on LinkedIn.

Speaker 0

领英真是让人尴尬。

Just LinkedIn is so cringe.

Speaker 0

全都一样。

Just all of it.

Speaker 0

我的意思是,我有

I mean, I have

Speaker 1

目前 mostly 是一些 AI 文章。

some mostly AI articles right now.

Speaker 0

是的。

Yes.

Speaker 0

我刚才在听一个参加创业播客的人说,他是怎么做到的,我不知道。

I was just listening to this guy who's like, who's on an entrepreneur podcast, and it's like, how I don't know.

Speaker 0

他搞了个类似播客播放器之类的东西。

He built something like a podcast player or or something like that.

Speaker 0

我觉得我有个特别棒的点子。

It's like, I'm a really I got such a good idea.

Speaker 0

我觉得我们能彻底改变这一切,会变得好太多了。

I'm under like, we're gonna completely revolutionize things, and it's gonna be so much better.

Speaker 0

所以我要做的是,开发一个非常智能的 AI 系统,能自动为我所有客户撰写 LinkedIn 帖子,你只需每月支付 100 美元,就能获得自动化 LinkedIn 服务。

So what I'm gonna do is I'm creating a really smart AI system that will automatically write LinkedIn posts for all of my clients, and you can just pay a $100 a month for like automated LinkedIn.

Speaker 0

我觉得,天啊,太糟糕了。

I'm like, God, it's so bad.

Speaker 0

总之,我不确定。

Anyway, don't know.

Speaker 0

但我感觉这个笑话

I feel like though that this this joke

Speaker 1

但为什么要费这个劲呢,因为所有读者也都是AI机器人。

But why bother because all the readers are AI bots also.

Speaker 1

大部分评论显然根本没读过。

Most of the comments are obviously didn't read it.

Speaker 0

我知道。

I know.

Speaker 0

太糟糕了。

It's so bad.

Speaker 0

但这个笑话还挺有趣的,跟AI和氛围编程有关。

But this still there's a funny joke here, it has to do with AI and vibe coding.

Speaker 0

好吧?

Okay?

Speaker 0

行。

K.

Speaker 0

现在每个人都是氛围程序员了。

So everyone's a vibe coder these days.

Speaker 0

对吧?

Right?

Speaker 0

你再也不需要真正的开发者了。

And you don't need to have real developers anymore.

Speaker 0

开发者毫无用处。

Developers are useless.

Speaker 0

我们只需要靠感觉就能搞定。

We could just vibe our way.

Speaker 0

你看,我们的项目经理已经写完了所有东西。

Look, our project manager has now written everything.

Speaker 0

一切都很好。

It's all good.

Speaker 0

所以这个笑话我叫它‘逆超人’。

And so this is like, I named this joke reverse Superman.

Speaker 0

有一个 vibe coder 穿着超人服装到处走,看到生产环境着火了,冲进电话亭,换上普通的休闲衣服,然后说:哇哦。

So there's a vibe coder walking around dressed in a Superman outfit, sees production on fire, runs into the phone booth, puts regular cool clothes on, goes, woo hoo.

Speaker 0

这里没什么需要我解决的。

Nothing for me to solve here.

Speaker 0

这就是 vibe coder 的逆超人。

Reverse Superman of vibe, Cody.

Speaker 0

你觉得怎么样?

How about that?

Speaker 1

是的。

Yeah.

Speaker 1

对。

Yeah.

Speaker 1

没错。

Exactly.

Speaker 1

对。

Yeah.

Speaker 0

嗯,

Well

Speaker 1

对。

Yeah.

Speaker 1

说到这个,

Speak speaking of yeah.

Speaker 1

我刚才提到Revsys了。

I was talking bringing up Revsys.

Speaker 1

我觉得应该是Revsys的那个人提到过,说 vibe 编程很棒,因为很多人做 MVP 时用它,然后一扩展就崩了,最后还得花钱请人来修复。

I think I think it was the dude from Revsys that mentioned that, like, vibe coding is awesome because he gets a lot of work of people building a MVP, and then they scale, and then it crashes, and then they need to pay somebody to fix it.

Speaker 0

是的。

Yeah.

Speaker 0

说实话,我们在谈论它的时候都是负面的。

I I you know, honestly, we're we're talking negative about it.

Speaker 0

如果你有个想法但不会编程,而AI能做出一个看起来跟你设想差不多的东西,你可以把它交给专业人士,说:我想让这个东西看起来更专业、更耐用。

If you've got an idea and you can't code and you can get AI to make something that looks pretty much like you would, could give that to a professional and say, I want this, but nice, so it lasts.

Speaker 0

这比‘我的想法写在餐巾纸上,咱们能做出来吗?’要前进太多了。

Like that is so much farther than, here's my idea on a napkin, can we build this?

Speaker 0

你明白我的意思吗?

You know what I mean?

Speaker 0

这确实是个加速器,很有用,但问题在于,当你想着‘我们就把它上线吧’的时候。

Like that that is an accelerant and that's useful, but the problem is when you're like, and we'll put it in production.

Speaker 1

但嗯,好吧。

But well, yeah.

Speaker 1

但我也能理解双方的观点。

But also just I can see both sides.

Speaker 1

如果你遇到了扩展问题,那说明你已经有客户了,这是好事。

The you if you have scaling problems, that means you've got customers, and that's a good thing.

Speaker 1

你验证了你的想法。

You validated your idea.

Speaker 1

没错。

Exactly.

Speaker 1

所以

So

Speaker 0

是的。

Yeah.

Speaker 0

作为开发者,很容易认为最难的部分是把东西做出来。

It's so easy as a developer to think the hard part is to build the thing.

Speaker 0

哦,不是的。

Oh, no.

Speaker 0

不是。

No.

Speaker 0

不是。

No.

Speaker 0

不。

No.

Speaker 0

最难的部分是让任何人关心、使用它、验证它,找到一个好点子,然后即使找到了,还要为它争取关注,是的。

The hard part is to get anyone to care, anyone to use it, anyone to validate it, to find an idea that is good, and then even if it is to get attention for it, like, yeah.

Speaker 0

如果你能解决这个问题,那么编码部分就很简单了,你知道的,这是一个可以自动化的流程。

If you can solve that problem, then the coding part is like, you know, it it's it's an automatable process.

Speaker 0

我是说自动化,你知道的,你只要这样持续努力,代码就会自然出来并正常运行,而且看起来大概就是这样。

An automate I mean, like, you know you grind this way until code comes out and it works, and it's got to look kind of like that.

Speaker 1

我希望软件开发能发展到这样的程度:我们能解决更多过去因为市场规模太小而被忽视的问题。

I hope that writing software becomes such that that we get more problems solved that that used to be used to be problems that aren't aren't large enough to have a market.

Speaker 1

现在,希望借助单人或双人开发团队,我们能更快地完成这些工作,为人们解决一些小问题。

And now hopefully with single or two developer teams or something, we can get things done quicker and solve some of these small problems for people.

Speaker 0

100%。

100%.

Speaker 0

这一定会发生。

That's going to happen.

Speaker 0

这肯定会发生的。

It's absolutely going to happen.

Speaker 1

大概吧。

Probably.

Speaker 0

好吧。

Alright.

Speaker 0

大概,也许吧。

Probably, maybe.

Speaker 1

很高兴再次和你聊天。

Well, it's good talking to you again.

Speaker 1

谢谢大家的参与。

Thanks, everybody, that showed up.

Speaker 1

这周聊天区里有很多精彩的讨论。

Lots of great conversations in the chat this week.

Speaker 0

确实如此。

Indeed.

Speaker 0

再见,各位。

Bye all.

Speaker 0

再见。

Bye.

关于 Bayt 播客

Bayt 提供中文+原文双语音频和字幕,帮助你打破语言障碍,轻松听懂全球优质播客。

继续浏览更多播客