文字起こし 🔗
WEBVTT
00:00:00.020 --> 00:00:05.300
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your buds.
00:00:05.720 --> 00:00:09.460
This is unbelievably episode 498 coming up on episode 500,
00:00:10.060 --> 00:00:12.440
recorded September 29th,
00:00:12.760 --> 00:00:13.180
2026.
00:00:13.520 --> 00:00:14.100
I'm Michael Kennedy.
00:00:14.400 --> 00:00:15.440
And I'm Calvin Hendrix Parker.
00:00:15.800 --> 00:00:18.180
Check us out on all the socials.
00:00:18.220 --> 00:00:21.320
We put all the links if you want to interact with us there at the top of the show.
00:00:21.720 --> 00:00:22.960
This episode is brought to you by us.
00:00:23.220 --> 00:00:25.940
So be sure to check out Six Feet Up if you have an amazing,
00:00:26.260 --> 00:00:27.020
you would like,
00:00:27.080 --> 00:00:31.100
People who've done a lot of problem solving in the Python space for many, many years.
00:00:31.580 --> 00:00:34.060
Reach out to Calvin and learn about Python.
00:00:34.500 --> 00:00:36.520
Got some courses over at Talk Python.
00:00:36.720 --> 00:00:37.460
They had new things coming.
00:00:37.660 --> 00:00:38.660
Nothing to announce yet,
00:00:38.880 --> 00:00:43.380
but a lot of work has been going lately on a new thing over there.
00:00:43.380 --> 00:00:43.960
So I'm very excited.
00:00:44.400 --> 00:00:45.100
Check out the newsletter.
00:00:45.430 --> 00:00:46.000
Just visit the homepage.
00:00:46.520 --> 00:00:46.880
Click newsletter.
00:00:47.080 --> 00:00:49.040
We got lots of cool things to send to you there.
00:00:49.500 --> 00:00:52.020
And with that, you have scary news.
00:00:52.070 --> 00:00:52.880
Are you going to scare us?
00:00:53.420 --> 00:00:54.160
Hopefully not too much.
00:00:54.280 --> 00:00:55.540
It's not quite October,
00:00:55.710 --> 00:00:59.840
although I do see lots and lots of decorations out in the stores these days for Halloween.
00:01:01.040 --> 00:01:02.240
But there is unfortunately...
00:01:02.240 --> 00:01:03.240
It's like a jump scare, right?
00:01:03.380 --> 00:01:04.140
A little bit, yeah.
00:01:04.900 --> 00:01:09.440
There's been a supply chain attack and there's no shortage of these over the last couple of years,
00:01:10.080 --> 00:01:15.120
probably due to the proliferation of AI and the tools that attackers can use to build these different exploits.
00:01:15.420 --> 00:01:18.760
This one is around MemTensor and MemoryOS.
00:01:18.800 --> 00:01:21.240
So some people may not be affected by this,
00:01:21.400 --> 00:01:25.000
but I think the real true story here is to follow
00:01:25.520 --> 00:01:28.680
how it's done and to protect your CI pipelines ultimately.
00:01:29.080 --> 00:01:31.220
So on September 23rd, an attacker
00:01:31.400 --> 00:01:33.840
published a backdoor into MemoryOS.
00:01:34.120 --> 00:01:38.640
So if you're using OpenClaw or if you have installed a MemoryOS
00:01:38.780 --> 00:01:41.180
skill into your agentic harness,
00:01:41.520 --> 00:01:42.920
you could be susceptible to this.
00:01:43.160 --> 00:01:44.319
So look for these various
00:01:44.340 --> 00:01:52.500
versions 0.1.21 on the plugin there's or that's the bad versions and 0.1.23 and 25 and then the
00:01:53.560 --> 00:02:02.080
memory os version 0.2 no sorry 2.0.34 the newest one that was released last week those are
00:02:02.540 --> 00:02:10.260
problematic they are going to launch a go process in the background even working around like the
00:02:10.179 --> 00:02:16.020
import path stuff won't get around this because it'll launch this what looks like a legitimate
00:02:16.280 --> 00:02:16.760
named thing,
00:02:17.180 --> 00:02:18.060
S-C-K-I-T.
00:02:18.340 --> 00:02:23.360
You may misview it as scikit, but it's actually S-C-K-I-T. It's a Go
00:02:23.680 --> 00:02:27.020
library that loads in the background. And what it does, scours your system for credentials,
00:02:27.640 --> 00:02:29.180
posts them to a command and control server,
00:02:29.460 --> 00:02:30.540
kind of the standard play there.
00:02:30.980 --> 00:02:31.720
And then it attempts
00:02:31.920 --> 00:02:35.780
to inject itself into other CI pipelines as a worm.
00:02:35.960 --> 00:02:38.019
So this one's not just an exploit that's
00:02:38.040 --> 00:02:39.740
and exfiltrate your credentials,
00:02:40.080 --> 00:02:42.540
they're actually looking to exfiltrate them, exploit them,
00:02:43.220 --> 00:02:47.040
and then turn them into a worm to gather more and more of them, whatever projects you're
00:02:47.430 --> 00:02:51.540
basically working on. So it traverses your home directory looking for PyPI tokens,
00:02:51.920 --> 00:02:52.580
GitHub tokens,
00:02:52.790 --> 00:02:53.540
you name it,
00:02:54.180 --> 00:02:57.420
and then sends them to a nefarious server someplace.
00:02:58.170 --> 00:02:59.820
Those then locate itself and try
00:02:59.820 --> 00:03:00.240
and go again.
00:03:00.630 --> 00:03:04.460
So if you are on these various versions of these various packages,
00:03:04.710 --> 00:03:05.120
make sure
00:03:05.100 --> 00:03:08.040
downgrade to the safe versions,
00:03:08.360 --> 00:03:13.840
the 2.0.33 of memory OS and 0.1.20 of the plugin and rotate
00:03:14.560 --> 00:03:18.160
every possible credential you have that's reachable from your home directory.
00:03:18.420 --> 00:03:19.320
Make sure you kill any
00:03:20.740 --> 00:03:26.060
SCKIT processes that are running because that is where it is talking to the command and control
00:03:26.100 --> 00:03:28.200
server. So unfortunate news,
00:03:29.180 --> 00:03:29.780
no fun.
00:03:30.280 --> 00:03:33.560
The write-up from SafeDep, which is linked to from the show
00:03:33.540 --> 00:03:38.960
notes here has a really good take on basically how they got in there's a couple spots where they
00:03:39.080 --> 00:03:45.420
don't know how they got some of the tokens they assume maybe social engineering or a leak of a
00:03:45.600 --> 00:03:52.040
github token someplace but the various projects have put in
Load full transcript
some fixes into their ci pipelines to
00:03:52.340 --> 00:03:56.580
hopefully prevent future attacks like this from happening and you probably could learn something
00:03:56.580 --> 00:04:02.099
a thing or two for your own ci pipelines to harden your processes as well that is a jump scare
00:04:02.380 --> 00:04:02.560
Yeah,
00:04:03.020 --> 00:04:03.840
less than fun.
00:04:04.110 --> 00:04:04.620
Less than fun.
00:04:04.900 --> 00:04:07.220
No one loves to hear that news on a Tuesday morning.
00:04:08.120 --> 00:04:11.220
But I think everyone needs to be aware and protect their CI pipelines.
00:04:11.350 --> 00:04:11.840
Because again,
00:04:12.000 --> 00:04:12.820
this is how they got in.
00:04:13.300 --> 00:04:15.860
They basically used the GitHub Actions pipelines.
00:04:16.239 --> 00:04:20.560
Not that GitHub Actions is in itself vulnerable to these things.
00:04:20.650 --> 00:04:22.440
It just enables these kinds of things.
00:04:23.200 --> 00:04:26.540
It's the other practices that are what made this possible.
00:04:26.800 --> 00:04:30.340
I remember how scary it was that there were worms on the internet,
00:04:30.460 --> 00:04:33.060
especially back when firewalls,
00:04:33.100 --> 00:04:33.680
what's a firewall?
00:04:33.880 --> 00:04:34.360
That's what a company,
00:04:34.580 --> 00:04:36.260
that's what like giant companies do.
00:04:36.580 --> 00:04:36.760
Yeah.
00:04:37.020 --> 00:04:37.580
So there's,
00:04:37.920 --> 00:04:38.400
on the webpage,
00:04:38.520 --> 00:04:41.000
they also link into the issue
00:04:41.640 --> 00:04:43.560
from the MemoryOS folks
00:04:43.900 --> 00:04:45.620
and the OpenClub plugin repositories.
00:04:46.300 --> 00:04:48.600
Again, I think it's a good responsible write-up
00:04:48.640 --> 00:04:49.240
of what happened.
00:04:50.200 --> 00:04:51.280
The repositories themselves
00:04:52.000 --> 00:04:53.320
don't have a lot of information on them,
00:04:53.500 --> 00:04:54.880
but this article does.
00:04:55.220 --> 00:04:55.400
Yeah.
00:04:55.740 --> 00:04:56.560
It's just, it's scary,
00:04:56.840 --> 00:04:57.060
you know,
00:04:57.420 --> 00:04:59.500
having very cool what we can do as developers,
00:04:59.620 --> 00:05:02.600
but at the same time, the responsibility of, oh my gosh,
00:05:03.220 --> 00:05:05.420
something got through and it didn't just
00:05:05.580 --> 00:05:06.040
affect me.
00:05:06.600 --> 00:05:08.060
It didn't just affect my users,
00:05:08.260 --> 00:05:10.160
but everybody who might have used something I created
00:05:10.360 --> 00:05:10.460
now,
00:05:10.960 --> 00:05:12.660
it's like taking over all of their music.
00:05:12.840 --> 00:05:13.300
Oh my gosh,
00:05:13.540 --> 00:05:14.640
that's a serious fire.
00:05:15.000 --> 00:05:15.380
So. I mean,
00:05:15.380 --> 00:05:19.540
it's a common complaint. Like, why can't we just dump files into a web route like we used to and
00:05:19.800 --> 00:05:22.220
deploy CGI applications?
00:05:22.840 --> 00:05:25.819
Because that was very dangerous. We just didn't know it yet because of
00:05:25.840 --> 00:05:28.460
the various vectors for exploit and attack.
00:05:29.240 --> 00:05:32.280
Deploying software safely requires a thoughtful
00:05:32.520 --> 00:05:33.320
and intentional process.
00:05:33.810 --> 00:05:33.960
Yeah.
00:05:34.420 --> 00:05:35.540
And to some degree,
00:05:36.640 --> 00:05:38.480
safety and isolation of your computer that makes
00:05:38.560 --> 00:05:38.900
that software.
00:05:39.100 --> 00:05:39.320
Very true.
00:05:39.700 --> 00:05:43.060
So yeah, pay attention to a lot of the sandboxing and containers and
00:05:43.060 --> 00:05:44.780
things like that that help you with those processes.
00:05:45.100 --> 00:05:46.560
Would you say you got to pay attention
00:05:46.670 --> 00:05:47.840
to like tiny little issues?
00:05:48.100 --> 00:05:49.100
Tiny things could,
00:05:49.320 --> 00:05:50.260
you know,
00:05:50.620 --> 00:05:52.060
be an interesting way to go.
00:05:52.980 --> 00:05:54.480
I want to talk about Tiny Mongo.
00:05:54.550 --> 00:05:55.340
Are you familiar with this?
00:05:55.560 --> 00:05:56.120
I am not, actually.
00:05:56.260 --> 00:05:56.920
I'm quite curious.
00:05:57.060 --> 00:05:59.500
My son actually was in a MongoDB hackathon over the weekend,
00:05:59.710 --> 00:06:00.520
so maybe he might be interested
00:06:00.630 --> 00:06:00.780
in this.
00:06:00.780 --> 00:06:03.680
This would have been absolutely awesome for that.
00:06:03.960 --> 00:06:05.820
I mean, maybe if it was about MongoDB,
00:06:06.020 --> 00:06:06.100
no.
00:06:06.380 --> 00:06:07.880
But I've covered this before, actually.
00:06:08.280 --> 00:06:12.140
Gives me a chance to highlight a cool little search feature of our, if you search them,
00:06:12.260 --> 00:06:16.100
you can actually say, only show me the episodes that exactly covered this.
00:06:16.460 --> 00:06:18.280
So way back in 2017,
00:06:18.800 --> 00:06:19.380
nine years ago,
00:06:19.810 --> 00:06:21.160
we covered Tiny Mongo.
00:06:21.620 --> 00:06:23.100
So the guy behind this,
00:06:23.440 --> 00:06:23.560
Steven,
00:06:23.860 --> 00:06:27.760
I had posted way back when I had posted some issue saying,
00:06:28.360 --> 00:06:29.200
this thing is cool.
00:06:29.620 --> 00:06:33.560
So let me tell you what TinyMongo is, and then I'll tell you why it's back on the show after
00:06:33.720 --> 00:06:33.980
nine years.
00:06:34.420 --> 00:06:38.120
So TinyMongo is what SQLite is to Postgres.
00:06:39.060 --> 00:06:40.480
TinyMongo is to MongoDB.
00:06:40.900 --> 00:06:41.080
Okay.
00:06:41.320 --> 00:06:41.780
In process,
00:06:42.640 --> 00:06:43.180
local file,
00:06:43.680 --> 00:06:44.140
but it goes,
00:06:44.380 --> 00:06:46.480
I don't know, it goes a little farther than SQLite,
00:06:46.640 --> 00:06:47.220
as you'll see,
00:06:47.540 --> 00:06:48.840
in some really interesting ways.
00:06:49.020 --> 00:06:52.860
but it uses well-known durable backends for the most part.
00:06:53.220 -->
00:06:55.960
So you can choose a really well-known,
00:06:56.260 --> 00:06:59.700
well-tested, well-trusted backend for this.
00:07:00.100 --> 00:07:01.720
But basically think in process,
00:07:02.400 --> 00:07:03.820
I want something without a server.
00:07:04.260 --> 00:07:06.980
Now, as part of this news item is very, very fast.
00:07:07.480 --> 00:07:12.220
So Stephen looked at this GitHub issue and decided, all right, I'm going to fix it.
00:07:12.300 --> 00:07:15.540
So the issue I filed a while ago was, this is really cool.
00:07:15.860 --> 00:07:17.800
It supports a subset of MongoDB,
00:07:18.480 --> 00:07:19.300
but not enough.
00:07:19.650 --> 00:07:19.780
Okay.
00:07:20.240 --> 00:07:20.960
So I was using,
00:07:21.200 --> 00:07:23.840
when I posted the issue, I think I was using MongoEngine.
00:07:24.740 --> 00:07:27.720
When he replied to the issue, I was using, what one was it?
00:07:27.870 --> 00:07:29.440
I was using a Pydantic-based one, Beanie.
00:07:29.820 --> 00:07:36.420
And then by the time he actually got the thing working, I was using just raw MongoDB queries.
00:07:36.980 --> 00:07:37.620
But I said, look,
00:07:37.960 --> 00:07:41.160
this is cool, but I can't use it with anything based on these ORMs
00:07:41.600 --> 00:07:45.580
because the ORMs have a certain set of startup things they do.
00:07:45.680 --> 00:07:47.280
like ensure these collections exist,
00:07:47.560 --> 00:07:48.720
ensure this index exists.
00:07:49.080 --> 00:07:53.000
You know, it's like testing different things as just part of the standard setup,
00:07:53.740 --> 00:07:55.960
you know, like it scaffolds the index automatically and stuff.
00:07:56.280 --> 00:07:57.120
And those things weren't working.
00:07:57.220 --> 00:08:00.880
So I said, would you be willing to put in enough structure,
00:08:01.140 --> 00:08:02.240
maybe even if there are no ops,
00:08:02.760 --> 00:08:07.320
that I could actually run a quote real application on top of tiny Mongo?
00:08:07.680 --> 00:08:09.740
Because there's all sorts of cool reasons you might want this.
00:08:09.840 --> 00:08:12.500
Like if you're doing a tutorial or a workshop,
00:08:12.820 --> 00:08:14.940
you don't want to have to start out and go now kids,
00:08:15.000 --> 00:08:18.760
The first thing we're going to start is by setting up a network server and securing it.
00:08:18.770 --> 00:08:19.260
Like, no, no, no.
00:08:19.700 --> 00:08:19.760
Yeah,
00:08:20.040 --> 00:08:20.620
there goes the day.
00:08:21.280 --> 00:08:21.780
You're like, okay,
00:08:21.940 --> 00:08:22.020
well,
00:08:22.640 --> 00:08:23.680
we're not doing the workshop anymore,
00:08:23.920 --> 00:08:24.000
right?
00:08:24.840 --> 00:08:26.760
But if you have something like SQLite, you can just say,
00:08:26.950 --> 00:08:27.880
this is the connection string.
00:08:28.320 --> 00:08:29.920
This is the uv pip install command.
00:08:30.410 --> 00:08:31.060
Now let's keep going.
00:08:32.099 --> 00:08:33.640
But it's the same program.
00:08:33.810 --> 00:08:37.940
You just change the connection string basically to get like a real server,
00:08:38.159 --> 00:08:38.219
right?
00:08:38.340 --> 00:08:39.760
Like to switch over to real Mongo or whatever.
00:08:40.140 --> 00:08:43.300
So Stephen took that idea and just totally ran with it.
00:08:43.760 --> 00:08:45.900
and came back to me and said, hey,
00:08:46.080 --> 00:08:47.400
look, what do I need?
00:08:48.180 --> 00:08:48.840
How about this?
00:08:49.110 --> 00:08:52.460
You know, this last question was asked in the time of AI,
00:08:53.010 --> 00:08:55.620
the time of really smart coding agents, right?
00:08:55.620 --> 00:08:57.080
Just the before times and there's now.
00:08:57.580 --> 00:08:57.820
Exactly.
00:08:58.210 --> 00:09:02.420
So I think this actually represents a really super interesting collaboration
00:09:03.320 --> 00:09:04.800
between me and Stephen.
00:09:05.300 --> 00:09:06.080
So, Stephen,
00:09:06.240 --> 00:09:06.340
sorry.
00:09:07.320 --> 00:09:08.820
So he said, well, what do I need?
00:09:08.820 --> 00:09:09.560
I said, well, how about this?
00:09:09.820 --> 00:09:13.300
why don't I just see if I can get Talk Python to run on top of this,
00:09:13.740 --> 00:09:14.400
just as it is?
00:09:14.740 --> 00:09:17.900
And I just said, all right, well, I'm going to take Mongo out.
00:09:18.260 --> 00:09:19.660
I'm going to stop talking to the real Mongo.
00:09:20.120 --> 00:09:22.660
And I'm going to put Tiny Mongo in and get it to run.
00:09:22.820 --> 00:09:24.300
And there were all these issues like,
00:09:24.720 --> 00:09:25.640
yeah, it technically works,
00:09:25.780 --> 00:09:27.640
but this thing is a thousand times slower in this way.
00:09:27.690 --> 00:09:27.820
It's like,
00:09:28.020 --> 00:09:28.120
oh.
00:09:28.440 --> 00:09:28.640
Interesting.
00:09:28.740 --> 00:09:29.720
I wasn't expecting that.
00:09:30.140 --> 00:09:30.240
Yeah.
00:09:30.480 --> 00:09:31.920
Well, it almost worked.
00:09:32.000 --> 00:09:33.600
Once we got it working, it was like, okay, now it works.
00:09:33.700 --> 00:09:34.020
But it's like,
00:09:34.580 --> 00:09:36.040
these five things are insanely slow.
00:09:36.340 --> 00:09:41.200
this type of query is not actually supported or limit doesn't actually limit it in the DB.
00:09:41.280 --> 00:09:43.620
It pulls it all back and then it like limits it in memory.
00:09:43.820 --> 00:09:44.880
You know, those kind of weird little,
00:09:45.700 --> 00:09:46.240
like it's fine.
00:09:46.260 --> 00:09:48.980
But if you've got hundreds of thousands or millions of records,
00:09:49.400 --> 00:09:49.660
you're like,
00:09:49.940 --> 00:09:50.100
no,
00:09:50.300 --> 00:09:50.440
this
00:09:50.480 --> 00:09:51.340
is not going to fly.
00:09:51.640 --> 00:09:52.880
This is out of control.
00:09:53.520 --> 00:09:58.500
So we went through all those and now it's like really quite close to MongoDB performance.
00:09:59.160 --> 00:10:03.760
Michael, would you recommend
this for production usage or is it still more for exploring,
00:10:03.940 --> 00:10:04.240
playing,
00:10:05.080 --> 00:10:05.420
teaching?
00:10:06.060 --> 00:10:07.160
I would recommend it.
00:10:07.230 --> 00:10:07.980
I think it's safe.
00:10:08.260 --> 00:10:09.040
I'll tell you why.
00:10:09.170 --> 00:10:09.600
I'll tell you why.
00:10:09.680 --> 00:10:11.400
I think it's, I would recommend it.
00:10:11.490 --> 00:10:15.120
If you would consider SQLite as your backend for production,
00:10:15.320 --> 00:10:16.940
which I think actually is viable.
00:10:17.420 --> 00:10:17.920
Yeah, it's very safe.
00:10:17.920 --> 00:10:18.720
I think that's very safe.
00:10:18.780 --> 00:10:21.520
It has restrictions on like parallel writers and stuff,
00:10:21.880 --> 00:10:23.380
but I do think it's quite safe.
00:10:23.640 --> 00:10:23.980
I agree.
00:10:24.280 --> 00:10:26.540
If you would consider SQLite as a backend,
00:10:26.690 --> 00:10:28.480
then I think this, I would recommend this as a backend.
00:10:28.860 --> 00:10:30.160
Yes, as we'll see.
00:10:30.270 --> 00:10:30.380
Okay,
00:10:30.860 --> 00:10:32.520
so let's go down.
00:10:33.120 --> 00:10:34.859
I mean, what's cool about it is the way you write
00:10:34.880 --> 00:10:36.320
is you just like write regular code
00:10:36.550 --> 00:10:38.540
and you just import tinymongo as PyMongo,
00:10:38.630 --> 00:10:41.960
which is the standard way of creating a thing.
00:10:41.970 --> 00:10:44.520
And you give it a connection string sort of deal
00:10:44.640 --> 00:10:46.680
that is like this file instead of this database.
00:10:47.220 --> 00:10:49.000
And then you just write regular queries against it,
00:10:49.150 --> 00:10:49.300
right?
00:10:49.660 --> 00:10:52.920
So what's really neat down here somewhere
00:10:53.240 --> 00:10:54.880
is all the different backends it has.
00:10:55.360 --> 00:10:57.480
So like SQLite,
00:10:57.510 --> 00:11:00.220
it might maybe even uses the SQLite version for this,
00:11:00.220 --> 00:11:00.680
I'm not sure,
00:11:01.020 --> 00:11:02.120
is you have an in-memory version.
00:11:02.410 --> 00:11:03.800
So it never even writes the disk.
00:11:03.900 --> 00:11:07.460
Like I'm doing unit tests or I'm just firing up this code,
00:11:08.100 --> 00:11:09.960
this data, I'm going to think about it and then throw it away.
00:11:10.290 --> 00:11:10.400
Right.
00:11:10.700 --> 00:11:11.220
That's pretty cool.
00:11:11.470 --> 00:11:13.100
It has this JSON backend,
00:11:13.280 --> 00:11:15.040
which is it's sort of default way.
00:11:15.270 --> 00:11:16.040
I haven't done it.
00:11:16.200 --> 00:11:22.020
This was not really able to totally solve the Talk Python runtime, I think, or it was like too slow or something.
00:11:22.420 --> 00:11:23.600
But switching to SQLite.
00:11:23.960 --> 00:11:27.520
So basically it uses SQLite with all of the SQLite transactions,
00:11:28.960 --> 00:11:31.100
write ahead log stuff and all that kind of stuff.
00:11:31.330 --> 00:11:33.200
And that's a really good production story.
00:11:33.560 --> 00:11:35.740
And then look at this, Calvin, sharded SQLite.
00:11:35.900 --> 00:11:38.040
I'm more curious about the next one, which is DuckDB.
00:11:38.960 --> 00:11:40.240
Yeah, so you're going to ask.
00:11:40.700 --> 00:11:42.860
Yeah, because there you've got real JSON support possibly.
00:11:43.420 --> 00:11:46.260
Yeah, Stefan is a huge fan of DuckDB and those kinds of things.
00:11:47.260 --> 00:11:50.340
So this is DuckDB and Parquet files as the backend,
00:11:50.720 --> 00:11:52.180
which is pretty interesting.
00:11:52.290 --> 00:11:56.080
So if you're doing data science-y things and you were doing Mongo type of queries,
00:11:56.360 --> 00:11:57.540
this is the way.
00:11:57.880 --> 00:11:58.500
This is a pretty good one.
00:11:58.860 --> 00:12:03.600
And then also it has a way to say like, you know, point that over at Postgres and MariaDB
00:12:04.140 --> 00:12:06.600
if you'd rather have something that's kind of like Mongo,
00:12:06.820 --> 00:12:07.940
but you don't actually run Mongo.
00:12:08.260 --> 00:12:10.680
I mean, you literally talk to it as if it was Mongo.
00:12:10.940 --> 00:12:12.240
Yeah, I'm unsure about that use case.
00:12:12.460 --> 00:12:13.420
I think it might just run Mongo.
00:12:13.800 --> 00:12:14.160
I would too.
00:12:14.560 --> 00:12:15.240
I would totally too.
00:12:15.700 --> 00:12:18.500
But I think the SQLite one, it's really good.
00:12:18.520 --> 00:12:19.860
We got it really, really dialed.
00:12:20.200 --> 00:12:21.960
So I actually linked to one of the issues.
00:12:22.120 --> 00:12:23.560
There's a bunch of issues over there.
00:12:24.420 --> 00:12:25.700
So I had some issues.
00:12:26.060 --> 00:12:27.680
Steven added him and sort of referenced me.
00:12:27.750 --> 00:12:29.180
And we just went back and forth.
00:12:29.760 --> 00:12:30.520
And I would say,
00:12:30.910 --> 00:12:31.320
hey, Claude.
00:12:31.340 --> 00:12:31.820
I'd open up,
00:12:32.040 --> 00:12:33.860
I had a branch for Talk Python.
00:12:34.100 --> 00:12:35.880
I'd open it up and said, hey, Claude,
00:12:36.430 --> 00:12:37.300
check out this GitHub issue.
00:12:37.740 --> 00:12:40.580
Can you try to implement it on top of this thing?
00:12:40.860 --> 00:12:42.180
And he would do it and say, well, I found all these issues.
00:12:42.290 --> 00:12:43.280
I said, okay, file some issues.
00:12:43.640 --> 00:12:48.000
Then Steven would have Codex look at it, fix it up,
00:12:48.300 --> 00:12:48.600
reply.
00:12:48.710 --> 00:12:50.820
And we would just pass it back and forth.
00:12:51.360 --> 00:12:55.500
And the reason that's interesting is I'm not giving him the Talk Python code base.
00:12:55.940 --> 00:12:59.820
And I ended up running on Talk Python training, which is like 300,000 lines of Python code
00:12:59.820 --> 00:13:00.820
and got it working there as well.
00:13:01.160 --> 00:13:02.340
But I'm not giving him that code.
00:13:02.490 -->
00:13:07.420
But he was able to literally prototype both from a performance and correctness perspective
00:13:07.980 --> 00:13:11.200
running on both those code bases by just bouncing back and forth.
00:13:11.720 --> 00:13:12.080
Well,
00:13:12.460 --> 00:13:17.580
my AI did your spike and it found that it ran like this and this worked and this didn't.
00:13:17.610 --> 00:13:19.120
And so, okay, I fixed this, try it again.
00:13:19.600 --> 00:13:23.640
And we just went back and forth for like over and over for days and got it really, really
00:13:23.920 --> 00:13:24.060
dialed.
00:13:24.140 --> 00:13:24.700
And I thought that was,
00:13:25.140 --> 00:13:26.720
that itself is worth covering here.
00:13:26.800 --> 00:13:27.380
Yeah, I like that workflow.
00:13:28.300 --> 00:13:28.400
Yeah,
00:13:28.830 --> 00:13:29.600
yeah, it's very interesting.
00:13:30.220 --> 00:13:30.420
Obviously,
00:13:30.720 --> 00:13:31.920
my prompts were like,
00:13:32.150 --> 00:13:35.180
you will not put any proprietary information,
00:13:35.860 --> 00:13:36.380
any secrets,
00:13:36.600 --> 00:13:37.760
any source code example.
00:13:37.900 --> 00:13:39.000
You will put all generic,
00:13:39.360 --> 00:13:39.740
you know what I mean?
00:13:40.240 --> 00:13:41.640
But at the same time, it totally worked.
00:13:41.860 --> 00:13:43.380
And it was really cool.
00:13:44.400 --> 00:13:46.980
But I think this is a super interesting thing
00:13:47.220 --> 00:13:49.360
because until this recent work,
00:13:49.620 --> 00:13:52.180
this version 1.3.1 that got released,
00:13:52.600 --> 00:13:54.640
There was no SQLite equivalent for MongoDB.
00:13:54.870 --> 00:13:56.460
And now I think there legitimately is.
00:13:56.620 --> 00:13:59.080
It's not 100% coverage, but it's quite high.
00:13:59.090 --> 00:14:01.180
It runs multiple real-time apps.
00:14:01.440 --> 00:14:01.980
Yeah, I like that.
00:14:02.200 --> 00:14:03.380
Well, especially for the education market,
00:14:03.770 --> 00:14:04.900
being able to teach someone really quickly
00:14:04.990 --> 00:14:07.000
without having to install and serve.
00:14:07.360 --> 00:14:09.160
And that's a huge barrier for a lot of people.
00:14:09.480 --> 00:14:09.680
Yeah.
00:14:09.810 --> 00:14:10.380
It looks really good.
00:14:10.820 --> 00:14:11.600
I'm really excited about it.
00:14:12.440 --> 00:14:13.680
Thank you, Stefan, for doing this work.
00:14:13.960 --> 00:14:16.460
And there might be a follow-up at some point as well.
00:14:16.660 --> 00:14:18.260
And what a great story for open source.
00:14:18.740 --> 00:14:18.940
Yeah,
00:14:19.290 --> 00:14:19.400
exactly.
00:14:19.800 --> 00:14:28.580
Like a really cool way to get some actual hands-on experience on real projects by sort of ping-ponging GitHub issues back and forth.
00:14:28.630 --> 00:14:29.000
It was crazy.
00:14:29.580 --> 00:14:30.120
Speaking of crazy,
00:14:30.640 --> 00:14:34.140
I've heard this topic is setting the world on fire.
00:14:35.120 --> 00:14:38.520
Well, and I wanted to bring it to light to get some people some exposure to it.
00:14:38.570 --> 00:14:42.160
If you've not heard of Jev yet, you're probably living under a rock someplace,
00:14:42.770 --> 00:14:43.260
and that's okay.
00:14:43.880 --> 00:14:47.160
But the folks over at RealPython did a tutorial
00:14:47.660 --> 00:14:49.620
of how to get started with Jev in Python.
00:14:50.300 --> 00:14:51.500
For those of you who don't know,
00:14:51.780 --> 00:14:55.160
Jev is a model from a company called TypeSafe AI
00:14:55.960 --> 00:14:59.280
that answers typed results like yes, no's, probabilities,
00:14:59.920 --> 00:15:00.180
scores,
00:15:00.540 --> 00:15:03.760
and pick from options instead of you talking with it.
00:15:03.760 --> 00:15:05.480
So you don't chat with Jev.
00:15:05.480 --> 00:15:07.100
You don't come into Jev and say,
00:15:07.120 --> 00:15:09.580
hey, build me an app or tell me a bear story
00:15:09.760 --> 00:15:11.340
or whatever the thing you may want.
00:15:11.600 --> 00:15:14.180
propose to JEV sets of information,
00:15:14.580 --> 00:15:15.520
evaluation,
00:15:16.240 --> 00:15:18.640
the kind of result you want. And then JEV can,
00:15:18.760 --> 00:15:19.360
in parallel,
00:15:19.620 --> 00:15:20.860
evaluate those things,
00:15:21.220 --> 00:15:22.680
either scoring them, giving them yes-nos.
00:15:23.060 --> 00:15:23.260
I mean,
00:15:23.520 --> 00:15:28.940
the docs from the tutorial are basically a customer service example where the customer says,
00:15:29.480 --> 00:15:33.020
I've tried contacting support like three times. Can I please get escalated?
00:15:33.200 --> 00:15:34.480
And so then the JEV
00:15:34.700 --> 00:15:39.720
for that basically is, here's how you know if the person is telling the truth or not. So they have a
00:15:39.660 --> 00:15:40.740
YesNo or TrueFall.
00:15:40.870 --> 00:15:42.800
And there's some custom various data types
00:15:42.830 --> 00:15:43.520
that go along with it.
00:15:43.920 --> 00:15:46.620
So what's nice is that the real Python article
00:15:46.770 --> 00:15:47.860
will get you started with Jev.
00:15:48.000 --> 00:15:49.040
So you'll understand the data types.
00:15:49.160 --> 00:15:50.620
You'll understand like what Jev's about,
00:15:50.840 --> 00:15:51.940
that you can't just chat with it.
00:15:52.420 --> 00:15:53.380
But I think,
00:15:53.600 --> 00:15:54.720
and the buzz is real.
00:15:54.810 --> 00:15:56.900
Like I've heard tons and tons of people talking about it.
00:15:57.150 --> 00:15:58.740
It looks like the invites are back open again.
00:15:58.790 --> 00:16:00.640
I was actually able to sign up for Jev this morning
00:16:00.980 --> 00:16:01.820
and try it out,
00:16:02.480 --> 00:16:03.720
but it is proprietary.
00:16:04.140 --> 00:16:07.180
Jev is a hosted closed wait model.
00:16:07.580 --> 00:16:08.960
There are no waits to download.
00:16:09.300 --> 00:16:10.820
There's no self-hosting of this thing.
00:16:11.360 --> 00:16:17.840
Everything called
OpenJev is an independent implementation and not TypeSafe's model,
00:16:18.220 --> 00:16:20.720
which means your data leaves your machine.
00:16:21.200 --> 00:16:23.800
So I don't know how much you trust TypeSafe AI.
00:16:24.500 --> 00:16:25.960
I don't know who they are,
00:16:26.120 --> 00:16:28.560
where they're hosted, what their business models are.
00:16:28.680 --> 00:16:29.600
Obviously, it's not free.
00:16:29.820 --> 00:16:33.440
You have to put a credit card down to use this model and try it out.
00:16:33.940 --> 00:16:38.660
But every call sends your input to the input text you put in there to a third party.
00:16:38.880 --> 00:16:39.500
So be careful,
00:16:39.760 --> 00:16:40.780
like much like you just mentioned
00:16:40.960 --> 00:16:42.420
how you are sanitizing your inputs
00:16:43.200 --> 00:16:45.500
for working back and forth on the tiny Mongo project
00:16:46.160 --> 00:16:46.440
with Stefan,
00:16:46.740 --> 00:16:48.780
be careful what you send into this one
00:16:48.920 --> 00:16:51.180
because you don't control it just as much as you control
00:16:51.360 --> 00:16:53.620
what you send to Anthropic or OpenAI.
00:16:54.660 --> 00:16:56.720
Those are pretty well established companies
00:16:57.020 --> 00:16:59.140
with a good business model and they seem to be running on,
00:16:59.440 --> 00:17:01.160
you know, credibility and reputation.
00:17:01.840 --> 00:17:03.540
You have to do your research and know
00:17:04.020 --> 00:17:05.199
what you're gonna be sending over there.
00:17:05.220 --> 00:17:07.020
So think twice before sending customer messages,
00:17:07.380 --> 00:17:08.079
tickets or anything sensitive.
00:17:08.600 --> 00:17:12.020
The other thing is like costs and stability are a question,
00:17:12.260 --> 00:17:12.360
right?
00:17:12.500 --> 00:17:17.220
So basically Jev bills themselves as very cheap and it is very cheap. Like you can,
00:17:17.780 --> 00:17:18.480
and very fast,
00:17:18.620 --> 00:17:20.100
you can have it sort through.
00:17:20.360 --> 00:17:21.520
I heard someone tell me an example,
00:17:21.839 --> 00:17:23.660
like look through my inbox of a
00:17:23.760 --> 00:17:24.319
million messages,
00:17:25.120 --> 00:17:27.540
categorizing them for like needs immediate attention,
00:17:28.360 --> 00:17:29.160
is about a customer,
00:17:29.640 --> 00:17:29.940
et cetera,
00:17:30.020 --> 00:17:30.340
et cetera.
00:17:30.500 --> 00:17:33.640
And it can build you a table and sort that table in just milliseconds.
00:17:34.020 --> 00:17:35.140
It's that fast.
00:17:35.500 --> 00:17:37.220
I want to give people an option here.
00:17:37.500 --> 00:17:38.700
It's a good practical intro.
00:17:39.190 --> 00:17:41.240
It shows how to use the null,
00:17:41.310 --> 00:17:42.820
the score, the choice primitives,
00:17:43.230 --> 00:17:44.520
but there are open options out there.
00:17:44.720 --> 00:17:46.240
I know I keep caveating
00:17:46.330 --> 00:17:47.040
this like episode,
00:17:47.300 --> 00:17:47.360
this,
00:17:47.520 --> 00:17:48.760
this section of the episode.
00:17:49.420 --> 00:17:50.980
There are some open options to look at
00:17:51.180 --> 00:17:51.380
instead.
00:17:52.100 --> 00:17:52.480
For example,
00:17:53.220 --> 00:17:54.180
Jevk5,
00:17:54.680 --> 00:17:57.700
it's an Apache 2.0 licensed weights and code.
00:17:58.030 --> 00:17:58.740
So that's kind of my
00:17:59.020 --> 00:18:00.540
front runner right now. I've not tried it,
00:18:00.880 --> 00:18:03.660
but it does accept type safe style requests.
00:18:04.030 --> 00:18:04.739
These are
00:18:04.800 --> 00:18:09.240
API compatible, but they are not the JEV model. So you're going to get different potential results.
00:18:09.720 --> 00:18:14.580
There's also one called SimF, which was formerly called OpenJEV. I'm sure lots of takedown notices
00:18:15.020 --> 00:18:18.440
came flying back and forth as all these alternatives came out that were also called
00:18:18.600 --> 00:18:19.660
something something JEV.
00:18:20.720 --> 00:18:22.060
Another one's OpenJEVSGLang.
00:18:22.620 --> 00:18:25.080
Again, the catch here is these are not
00:18:25.240 --> 00:18:26.700
the JEV model. They are close.
00:18:26.880 --> 00:18:31.200
There was actually a really interesting JEV in 25 lines of Python,
00:18:31.340 --> 00:18:33.340
on a little bit tongue in cheek post
00:18:33.460 --> 00:18:35.040
that also came out about this.
00:18:35.240 --> 00:18:37.740
But what they did here was use the Quinn three model
00:18:38.220 --> 00:18:40.020
and told it to act like Jev.
00:18:40.420 --> 00:18:43.480
And for most things, I think it gave reasonable results,
00:18:43.680 --> 00:18:44.960
but also at the very end,
00:18:45.220 --> 00:18:47.680
this was a real tongue in cheek post
00:18:48.000 --> 00:18:53.000
kind of poking fun at the hype that is Jev right now.
00:18:53.260 --> 00:18:54.840
So I wanted to put that out there for folks
00:18:54.960 --> 00:18:56.940
to be just mostly aware of the fact
00:18:56.940 --> 00:18:58.720
that you're sending your data to a proprietary company
00:18:59.140 --> 00:19:01.300
and be careful what you're sending to it
00:19:01.320 --> 00:19:06.140
totally trust it and have a business agreement with that organization beyond putting your credit
00:19:06.160 --> 00:19:07.280
card into a credit card field.
00:19:07.780 --> 00:19:11.600
So I hope folks are vigilant as they go forth and try these things.
00:19:11.780 --> 00:19:12.980
The hype is real.
00:19:13.160 --> 00:19:17.700
Oh my gosh, you couldn't again move last week without hearing about Jev in some
00:19:17.920 --> 00:19:21.500
meeting and some article and some topic.
00:19:22.180 --> 00:19:24.440
It's a very interesting way and a very interesting usage.
00:19:24.920 --> 00:19:25.340
It's a very,
00:19:25.500 --> 00:19:31.280
I think it's a great pattern for reducing token spend and usage on other models
00:19:31.300 --> 00:19:33.160
collaboration or combination with other models,
00:19:33.480 --> 00:19:35.360
but you need to understand what it really means
00:19:35.500 --> 00:19:36.100
in action.
00:19:36.360 --> 00:19:38.080
It's a super cool thing.
00:19:38.280 --> 00:19:39.460
You're right. It's absolutely blowing.
00:19:39.740 --> 00:19:40.420
Jev is blowing up.
00:19:41.300 --> 00:19:43.460
I had to watch some YouTube videos this week.
00:19:44.580 --> 00:19:46.920
I'm missing something because there's a lot of this
00:19:47.000 --> 00:19:49.180
thing I've never heard of going on around and around.
00:19:49.420 --> 00:19:51.000
When you sign up for a Jev account,
00:19:51.200 --> 00:19:56.280
it makes you take a pop quiz to ask you whether or not you can chat with Jev. I won't give you the
00:19:56.400 --> 00:19:59.120
answer because if you don't know, you shouldn't probably be using Jev.
00:19:59.340 --> 00:20:00.200
If you got to ask,
00:20:00.540 --> 00:20:01.440
It's not for you.
00:20:01.640 --> 00:20:01.780
Yeah.
00:20:01.920 --> 00:20:12.660
I was going to say that there's never been a time, I think, where we're sending as much detailed information to other companies and other places as the last couple years.
00:20:14.420 --> 00:20:15.400
Be careful out there, folks.
00:20:16.080 --> 00:20:16.800
It's real.
00:20:18.140 --> 00:20:18.260
Yeah.
00:20:18.600 --> 00:20:21.760
But the reason we're doing it is because it's so productive and so useful, right?
00:20:21.940 --> 00:20:22.140
It is.
00:20:22.320 --> 00:20:23.120
I mean, the patterns,
00:20:23.780 --> 00:20:24.120
I think,
00:20:24.320 --> 00:20:25.880
in looking at some of those open wide options,
00:20:26.380 --> 00:20:28.360
if you can put in place, again,
00:20:28.520 --> 00:20:28.860
I'll stress,
00:20:29.140 --> 00:20:30.340
probably why I stressed things last week.
00:20:30.460 --> 00:20:31.160
was around evals.
00:20:31.600 --> 00:20:35.720
Building good evals for your CI pipeline to run against these models,
00:20:35.910 --> 00:20:36.020
whether
00:20:36.140 --> 00:20:40.880
they're classifiers like JEV or whether they're LLMs like the QIN or other open weights models,
00:20:41.340 --> 00:20:43.560
means you can swap back and forth with confidence.
00:20:43.890 --> 00:20:45.880
And if you can do that, you can use one of these
00:20:45.980 --> 00:20:46.640
open weights models,
00:20:46.950 --> 00:20:47.500
open source,
00:20:47.970 --> 00:20:50.700
even versions of these models with more confidence on your own
00:20:50.860 --> 00:20:53.480
GPUs. These things will run on even very small CPU,
00:20:53.900 --> 00:20:54.020
GPU.
00:20:54.200 --> 00:20:56.779
I think there was a QIN 306B model that
00:20:56.800 --> 00:21:01.600
they're using in the parody article that runs on like a raspberry pi you can get those anywhere
00:21:02.060 --> 00:21:07.740
nice but i'm not using Anthropic for something i've been using glm53 flash and that's been
00:21:08.040 --> 00:21:12.820
super super neat but i want to talk about an age of innocence that may be over here this is an
00:21:12.930 --> 00:21:17.100
article i don't typically cover articles i typically more but but it kind of pulls out it highlights a
00:21:17.180 --> 00:21:22.540
really important thing that the reason i pull it up is because it kind of broke my understanding of
00:21:22.560 --> 00:21:25.920
Python performance tips for one particular axis.
00:21:26.580 --> 00:21:30.360
So this is by Timothy Ivankov.
00:21:30.780 --> 00:21:32.560
So cool to write this up.
00:21:32.950 --> 00:21:35.200
I think it might have had a little writing help, but that's okay.
00:21:35.510 --> 00:21:36.500
So here's the headline.
00:21:36.800 --> 00:21:39.140
It's reading Dunderdict once,
00:21:39.780 --> 00:21:40.200
one time.
00:21:40.480 --> 00:21:45.900
Reading Dunderdict of an object permanently de-optimizes attribute access.
00:21:46.400 --> 00:21:46.620
What?
00:21:47.380 --> 00:21:48.060
Why is that?
00:21:48.400 --> 00:21:49.220
Why is that not good?
00:21:49.830 --> 00:21:51.540
And I was a wonder's point of this comes from PyCoder.
00:21:51.860 --> 00:21:54.100
The permanence of it is the striking bit.
00:21:54.620 --> 00:21:56.880
Permanently, for the rest of that object's life cycle,
00:21:57.350 --> 00:21:58.980
its performance is broken.
00:21:59.430 --> 00:21:59.540
Okay,
00:21:59.700 --> 00:22:01.900
so here's an old performance tip.
00:22:02.360 --> 00:22:03.760
And I'll tell you the one that I used
00:22:03.880 --> 00:22:04.740
that I thought was amazing.
00:22:05.030 --> 00:22:05.820
And it was amazing.
00:22:06.060 --> 00:22:08.480
If I have a loop and in this hot,
00:22:08.660 --> 00:22:09.680
let's call it a hot loop here.
00:22:09.860 --> 00:22:10.460
This is an example.
00:22:10.490 --> 00:22:11.100
A million times around,
00:22:11.150 --> 00:22:12.100
we're just going to do the same thing.
00:22:12.260 --> 00:22:12.900
Like we're going to say,
00:22:13.280 --> 00:22:13.840
create an attribute,
00:22:14.450 --> 00:22:15.000
self.value,
00:22:15.440 --> 00:22:17.100
access self.value in the loop,
00:22:17.580 --> 00:22:20.180
increment plus equals on the self.value.
00:22:20.540 --> 00:22:20.620
Well,
00:22:21.220 --> 00:22:21.740
traditionally,
00:22:22.020 --> 00:22:24.500
that would go into the DunderDict, find the value,
00:22:24.940 --> 00:22:25.520
pull that value
00:22:25.640 --> 00:22:26.360
out, change it,
00:22:26.680 --> 00:22:28.120
store it back into the DunderDict, right?
00:22:28.200 --> 00:22:31.460
That was the backing store for its fields,
00:22:31.800 --> 00:22:32.240
which is weird,
00:22:32.420 --> 00:22:33.140
but that's how it worked.
00:22:33.420 --> 00:22:34.240
So here's what you do.
00:22:34.560 --> 00:22:37.060
Instead of doing that interchange over and over and over,
00:22:37.220 --> 00:22:38.380
do it on a local variable.
00:22:38.760 --> 00:22:39.200
Create a value,
00:22:39.540 --> 00:22:42.920
do all your work on a local variable in the function,
00:22:43.400 --> 00:22:44.080
and then at the end,
00:22:44.240 --> 00:22:46.340
set the value to the class,
00:22:46.680 --> 00:22:46.760
right?
00:22:47.040 --> 00:22:49.280
Create a value, and then eventually say self.value equals value,
00:22:49.560 --> 00:22:49.640
right?
00:22:49.720 --> 00:22:50.160
Super simple.
00:22:50.450 --> 00:22:52.520
That used to make a big, big difference.
00:22:53.360 --> 00:22:57.460
And now it does still a little bit,
00:22:58.020 --> 00:22:59.980
does a little bit. So it technically works.
00:23:00.460 --> 00:23:00.720
However,
00:23:01.140 --> 00:23:03.120
if you do this enough times,
00:23:03.470 --> 00:23:04.380
it turns out
00:23:04.860 --> 00:23:10.820
that the new specializing adaptive interpreter notices that and it drops the load adder,
00:23:10.970 --> 00:23:14.980
which is the bytecode instruction that reads the field from the dictionary.
00:23:15.460 --> 00:23:16.840
Eventually it drops it
00:23:16.880 --> 00:23:18.660
and it starts processing it different,
00:23:19.080 --> 00:23:19.160
right?
00:23:19.450 --> 00:23:23.160
And so what it does is it actually starts to look at just,
00:23:23.210 --> 00:23:24.080
well, where in the offset,
00:23:24.980 --> 00:23:26.020
like a fixed byte offset
00:23:26.270 --> 00:23:28.440
into the object's storage for this,
00:23:28.630 --> 00:23:29.120
which is like,
00:23:29.480 --> 00:23:29.560
wow,
00:23:29.790 --> 00:23:29.920
okay,
00:23:30.140 --> 00:23:30.580
pretty cool.
00:23:31.020 --> 00:23:32.760
So that's, I think, since 13,
00:23:33.080 --> 00:23:33.820
really interesting.
00:23:34.220 --> 00:23:36.060
And you can see the different aspects.
00:23:36.350 --> 00:23:39.300
It turns out that it's even more significant,
00:23:39.760 --> 00:23:42.760
this change of the problem they're suggesting or pointing out.
00:23:43.180 --> 00:23:44.220
Is that really a problem?
00:23:44.420 --> 00:23:45.720
It's just breaks in optimization.
00:23:46.240 --> 00:23:48.720
that the breakage is stronger in a free threaded world.
00:23:49.040 --> 00:23:50.260
And the article goes into why.
00:23:50.600 --> 00:23:51.300
So check this out.
00:23:51.420 --> 00:23:52.280
If you just say,
00:23:52.620 --> 00:23:54.460
like maybe this is like a debugging thing or whatever,
00:23:54.520 --> 00:23:57.340
you just say print dunder dict of the object
00:23:57.580 --> 00:23:59.040
and then you go have that function run.
00:23:59.380 --> 00:24:01.520
All of a sudden it's 50 milliseconds
00:24:01.800 --> 00:24:02.740
instead of 30 milliseconds.
00:24:03.280 --> 00:24:04.400
1.5 times slower.
00:24:04.820 --> 00:24:05.380
What do you think?
00:24:06.840 --> 00:24:08.620
It's intense to get down to that level.
00:24:09.020 --> 00:24:11.540
It is, but there's a bunch of little simple things
00:24:11.960 --> 00:24:12.380
that you're like,
00:24:13.220 --> 00:24:15.240
I could read the fields
00:24:15.260 --> 00:24:19.560
or I could just say star star dunderdict and do this and that.
00:24:19.580 --> 00:24:20.820
And it turns out that that actually,
00:24:21.340 --> 00:24:22.640
it didn't used to make any difference,
00:24:23.180 --> 00:24:26.000
but because of the specializing adaptive interpreter,
00:24:26.720 --> 00:24:27.300
now it does,
00:24:27.780 --> 00:24:27.920
right?
00:24:28.240 --> 00:24:30.680
So like if you just ask vars of an object
00:24:31.180 --> 00:24:33.600
or if you ask if a field is in the dictionary,
00:24:34.200 --> 00:24:35.420
well, here's the really tricky one,
00:24:35.660 --> 00:24:36.600
a shallow copy,
00:24:37.080 --> 00:24:37.140
right?
00:24:37.240 --> 00:24:38.560
Like, well, that's a totally reasonable thing.
00:24:38.780 --> 00:24:41.600
I'm going to clone this before I hand it back or something.
00:24:42.000 --> 00:24:43.100
Well, that clone that you did,
00:24:43.440 --> 00:24:44.680
it can attribute access.
00:24:45.140 --> 00:24:49.800
to access it yeah it makes it 50 slower i've definitely done that mostly when i'm debugging
00:24:49.880 --> 00:24:55.200
or triaging code or kind of walking through the interpreter because it's easy to access i can't
00:24:55.300 --> 00:24:59.520
think of too many times where i would have tried to do it in code you could see how it's a it's an
00:24:59.620 --> 00:25:04.100
easy workaround it's like oh it's just right there i'm going to reach for it yeah exactly so these
00:25:04.500 --> 00:25:08.960
the the first three like are kind of um debugging ones but this last shallow copy this is a
00:25:08.980 --> 00:25:09.940
legitimate thing,
00:25:10.100 --> 00:25:10.880
right? That you might do.
00:25:11.300 --> 00:25:15.420
And so here's the, this is the part that I didn't
00:25:15.900 --> 00:25:19.960
get because the world has changed and I haven't been like prototyping everything at that level.
00:25:20.360 --> 00:25:21.920
I'm a big fan of dunder slots.
00:25:22.310 --> 00:25:24.420
It means you can't dynamically add stuff to your class,
00:25:24.940 --> 00:25:25.720
but more importantly,
00:25:25.900 --> 00:25:30.540
used to mean that this whole dictionary mechanism was no longer used.
00:25:30.570 --> 00:25:35.320
And it basically used an offset into a list that was just in each instance.
00:25:35.520 --> 00:25:36.659
So it honestly made
00:25:36.680 --> 00:25:42.080
things a lot better in terms of memory and in terms of attribute access was significantly faster.
00:25:42.540 --> 00:25:42.780
Well,
00:25:43.300 --> 00:25:47.900
apparently slots makes no difference anymore because the specializing adaptive
00:25:48.120 --> 00:25:48.360
interpreter,
00:25:48.560 --> 00:25:50.420
at least in this use case, right? This is like a,
00:25:50.740 --> 00:25:52.020
I'm accessing the same thing a
00:25:52.180 --> 00:25:55.460
lot of times, right? It could be, you know, profiling is tricky.
00:25:55.960 --> 00:25:57.000
Performance is tricky,
00:25:57.500 --> 00:26:03.840
but basically the specializing adaptive interpreter for hot pass slots versus not didn't really matter.
00:26:04.060 --> 00:26:07.440
And I didn't know about
slots until I read Luciano's book,
00:26:07.760 --> 00:26:08.180
Fluent Python.
00:26:08.760 --> 00:26:10.580
That's where I discovered that.
00:26:10.750 --> 00:26:14.320
And now you're saying it really doesn't matter anymore because of the new bits in there.
00:26:14.620 --> 00:26:14.820
Yeah,
00:26:15.120 --> 00:26:15.240
exactly.
00:26:15.480 --> 00:26:20.080
So I believe I might have learned about it as well from Luciano's book.
00:26:20.940 --> 00:26:21.260
So yeah,
00:26:21.680 --> 00:26:23.020
3.11 and beyond,
00:26:23.280 --> 00:26:25.560
there's a lot of the faster CPython thing.
00:26:25.960 --> 00:26:26.480
Changed some of these things.
00:26:26.550 --> 00:26:27.940
And it changed how this,
00:26:28.100 --> 00:26:30.220
especially with the specialized and adaptive interpreter,
00:26:30.640 --> 00:26:33.200
changed a lot about how this dictionary and access,
00:26:33.700 --> 00:26:34.820
and that's the whole story,
00:26:34.980 --> 00:26:35.500
slots,
00:26:36.200 --> 00:26:36.800
dictionary access,
00:26:37.640 --> 00:26:41.120
optimizing or not optimizing it, and so on. So I thought this was an interesting
00:26:41.250 --> 00:26:42.440
dive into something that's,
00:26:42.780 --> 00:26:44.740
you know, everyone uses classes,
00:26:45.300 --> 00:26:45.560
objects,
00:26:46.360 --> 00:26:47.120
even if they're not big
00:26:47.680 --> 00:26:48.560
OOP folks,
00:26:48.810 --> 00:26:50.200
you still create objects.
00:26:50.770 --> 00:26:51.780
I mean, do you have a number?
00:26:52.250 --> 00:26:52.700
You know what I mean?
00:26:53.870 --> 00:26:54.020
Well,
00:26:54.260 --> 00:26:54.440
it's just,
00:26:54.600 --> 00:26:55.180
and it's convenient,
00:26:55.640 --> 00:26:56.860
but I think if you were,
00:26:57.130 --> 00:26:57.260
again,
00:26:57.420 --> 00:26:58.620
performance debugging and
00:26:58.640 --> 00:27:00.120
reaging and you ran into this,
00:27:00.340 --> 00:27:01.440
you've been surprised. Yes,
00:27:01.680 --> 00:27:02.980
I would. I would certainly say
00:27:03.180 --> 00:27:04.000
so. I would say so.
00:27:04.280 --> 00:27:04.680
Michael,
00:27:04.880 --> 00:27:08.580
would you want an interesting way to find out what's new or what's
00:27:08.800 --> 00:27:09.740
newt in Python?
00:27:10.540 --> 00:27:12.800
So I got this extra here I wanted to share.
00:27:13.400 --> 00:27:14.520
This is cool.
00:27:14.780 --> 00:27:15.720
I've seen this now. I
00:27:15.740 --> 00:27:20.760
thought I had not seen. I've seen this is cool. This is a dungeon crawler called what's newt.
00:27:21.400 --> 00:27:24.800
And it, but what it does is it runs you through the what's new in Python.
00:27:24.960 --> 00:27:26.100
And this version is
00:27:26.120 --> 00:27:27.340
specific for 3.15.
00:27:27.700 --> 00:27:31.080
You can't run it with prior versions because it actually uses the features in
00:27:31.200 --> 00:27:35.800
3.15 to check that you've completed the challenge in the dungeon.
00:27:36.100 --> 00:27:37.460
So I've got the dungeon up right
00:27:37.540 --> 00:27:41.540
here. So I'll just read off real quick. So this one starts off with the first room of the
00:27:41.700 --> 00:27:43.560
interpreter and the one nobody sees.
00:27:44.160 --> 00:27:48.000
Slips of paper are wedged into every crack of the masonry.pth
00:27:48.160 --> 00:27:48.340
files.
00:27:48.840 --> 00:27:49.360
Hundreds of them,
00:27:49.700 --> 00:27:52.220
each one adding a directory to the path.
00:27:52.500 --> 00:27:53.640
A few begin with the words
00:27:53.740 --> 00:27:54.120
import.
00:27:54.650 --> 00:27:56.640
And those have scorch marks,
00:27:57.140 --> 00:27:57.500
rightfully so.
00:27:57.800 --> 00:28:00.360
A brass plaque is bolted to the wall. A new file
00:28:00.620 --> 00:28:02.700
sits on the lectern beneath it, unwritten.
00:28:03.010 --> 00:28:03.840
And so at this point,
00:28:04.050 --> 00:28:04.580
you have a puzzle,
00:28:04.800 --> 00:28:05.420
which is what
00:28:05.680 --> 00:28:07.140
runs before your program does.
00:28:07.560 --> 00:28:09.260
And it has a link actually in the terminal.
00:28:09.810 --> 00:28:10.740
That is a hyperlink.
00:28:11.020 --> 00:28:12.840
It's a nice little TUI app.
00:28:13.010 --> 00:28:17.040
And when you click on that, it'll open up the related PEP to basically
00:28:17.280 --> 00:28:19.880
give you a hint for it. So if you want to solve it, you just type solve.
00:28:20.320 --> 00:28:21.460
I'll type solve.
00:28:23.180 --> 00:28:23.620
It'll
00:28:23.640 --> 00:28:28.780
my butt because it does not have VI key bindings in there. So I had to like use my arrow keys.
00:28:28.920 --> 00:28:31.160
You probably had almost just like a caveman.
00:28:33.060 --> 00:28:36.760
And so based on the PEP 829,
00:28:37.100 --> 00:28:38.060
it added in the new
00:28:38.380 --> 00:28:39.040
namespace,
00:28:39.240 --> 00:28:46.680
a callable syntax for bringing in a callable into your PTH file or the new
00:28:47.640 --> 00:28:50.900
sys.path, for example. So they're deprecating the word import.
00:28:51.720 --> 00:28:53.680
And now 315 adds this file format
00:28:53.840 --> 00:28:54.940
that can only name a callable.
00:28:55.480 --> 00:28:57.020
Here's how you write it. And when you click check,
00:28:57.440 --> 00:28:57.680
it's like
00:28:58.020 --> 00:29:03.200
solved. A reader can now see what starts up without executing it. The site modules batches every static
00:29:03.740 --> 00:29:05.020
sys.path extension first,
00:29:05.470 --> 00:29:09.260
and then only runs the startup callable so that a.start file can rely on
00:29:09.260 --> 00:29:10.340
the path being complete.
00:29:10.840 --> 00:29:12.200
Please press enter when you're finished reading.
00:29:12.510 --> 00:29:13.580
And then it takes you into
00:29:14.120 --> 00:29:15.400
Do you want to go north,
00:29:15.620 --> 00:29:15.720
south,
00:29:15.880 --> 00:29:16.060
east,
00:29:16.260 --> 00:29:18.480
west on your journey and learn more?
00:29:18.900 --> 00:29:21.300
And tracks your
progress so you can see what scores I've gotten,
00:29:21.460 --> 00:29:22.480
how many puzzles I've solved.
00:29:22.900 --> 00:29:25.300
If you go east, it's a very lazy path.
00:29:25.620 --> 00:29:25.860
Yeah.
00:29:26.180 --> 00:29:27.420
So that's super fun.
00:29:28.840 --> 00:29:32.840
I've not spent enough time reading the what's new in newer versions of Python,
00:29:33.080 --> 00:29:33.300
kind of like
00:29:33.300 --> 00:29:35.160
you alluded to in the last article,
00:29:35.630 --> 00:29:36.780
because we just use Python.
00:29:37.320 --> 00:29:40.280
And a lot of times I'm not leveraging some of these new features, but this is a fun way
00:29:40.290 --> 00:29:41.240
to learn what they are.
00:29:41.440 --> 00:29:42.340
I figured I'd throw that in there.
00:29:42.680 --> 00:29:42.920
Oh,
00:29:43.170 --> 00:29:43.880
it is very fun.
00:29:43.890 --> 00:29:44.660
This is from Barry Warsaw,
00:29:44.920 --> 00:29:45.000
right?
00:29:45.150 --> 00:29:45.640
I believe so.
00:29:46.540 --> 00:29:47.200
That's a good question.
00:29:47.470 --> 00:29:48.540
I believe so.
00:29:48.880 --> 00:29:49.380
What's new?
00:29:49.480 --> 00:29:49.840
It is.
00:29:49.890 --> 00:29:50.180
You're right.
00:29:50.270 --> 00:29:50.900
It is Barry Warsaw.
00:29:51.350 --> 00:29:51.440
Yep.
00:29:51.610 --> 00:29:52.120
Good job, Barry.
00:29:52.300 --> 00:29:52.960
Nice work, Barry.
00:29:53.010 --> 00:29:53.400
I love it.
00:29:53.640 --> 00:29:54.200
I'm here for it.
00:29:54.270 --> 00:30:00.460
And especially with the hype around Dungeon Crawler Carl right now, this is very appropriate.
00:30:00.860 --> 00:30:02.880
Brings me back to the days of MUDs.
00:30:02.890 --> 00:30:04.560
I used to play multi-user dungeons.
00:30:04.850 --> 00:30:05.240
I mean,
00:30:05.440 --> 00:30:09.000
me and my friends, we would spend tons of time in these places back in high school.
00:30:09.120 --> 00:30:11.500
People got to remember when I was in high school,
00:30:11.730 --> 00:30:13.300
there literally was no web.
00:30:14.240 --> 00:30:15.420
Not like it was bad.
00:30:16.820 --> 00:30:17.760
We're dinosaurs roaming.
00:30:17.890 --> 00:30:18.300
The worldwide web,
00:30:18.570 --> 00:30:19.040
I know.
00:30:19.860 --> 00:30:23.520
The whole thing was created in 1993 when I was in college.
00:30:23.820 --> 00:30:24.380
So before that,
00:30:24.560 --> 00:30:24.980
you're like,
00:30:25.500 --> 00:30:26.220
well, we got Telnet.
00:30:26.330 --> 00:30:27.260
What are we going to do, folks?
00:30:27.600 --> 00:30:27.840
Yep.
00:30:28.060 --> 00:30:28.320
Muds.
00:30:28.620 --> 00:30:29.380
That's what we're going to do.
00:30:29.600 --> 00:30:30.240
We're going to use Gopher.
00:30:30.250 --> 00:30:30.760
It was a lot like this.
00:30:31.280 --> 00:30:31.380
Yeah.
00:30:31.540 --> 00:30:31.860
Gopher,
00:30:32.100 --> 00:30:32.500
Archie,
00:30:32.980 --> 00:30:33.800
Telnet.
00:30:33.930 --> 00:30:34.500
Oh my gosh.
00:30:34.650 --> 00:30:35.080
News groups.
00:30:35.760 --> 00:30:35.980
Yeah.
00:30:36.420 --> 00:30:37.500
Get your newsreader out.
00:30:37.600 --> 00:30:39.640
What's so ironic is it was so amazing.
00:30:40.040 --> 00:30:41.640
And it seems so futuristic.
00:30:42.140 --> 00:30:43.840
I bought things off of news groups,
00:30:44.240 --> 00:30:47.240
like going in through Telnet and then getting the news
00:30:47.380 --> 00:30:47.440
groups.
00:30:47.520 --> 00:30:50.700
And I bought an expansion card for my HP 48 GX.
00:30:51.060 --> 00:30:51.280
Incredible.
00:30:51.800 --> 00:30:52.080
All right.
00:30:52.260 --> 00:30:52.380
Well,
00:30:52.600 --> 00:30:54.180
from the past to the future,
00:30:54.560 --> 00:30:55.240
well, to the present,
00:30:55.440 --> 00:30:56.880
which feels actually legitimately
00:30:57.280 --> 00:30:57.360
future.
00:30:57.360 --> 00:30:57.960
Tell me about the future.
00:30:58.360 --> 00:30:59.340
Things used to be so simple.
00:30:59.420 --> 00:31:05.260
You mentioned throwing just a set of files to a folder and you may be behind a C panel
00:31:05.320 --> 00:31:07.000
so you can admin your website.
00:31:07.340 --> 00:31:09.560
Oh, that was almost too modern for me, C-panel.
00:31:09.740 --> 00:31:09.880
Yeah.
00:31:10.360 --> 00:31:11.480
Yeah, just FTP it up.
00:31:11.480 --> 00:31:11.840
I'm sorry.
00:31:12.200 --> 00:31:14.340
Not even SFTP, just straight FTP.
00:31:14.560 --> 00:31:15.680
Just open FTP.
00:31:17.160 --> 00:31:20.720
So I want to come back and do one more Kyle Lintit
00:31:21.840 --> 00:31:23.640
because I couldn't help myself,
00:31:23.980 --> 00:31:24.120
Calvin.
00:31:24.260 --> 00:31:24.940
I saw,
00:31:25.100 --> 00:31:27.460
oh my God, I saw this one
00:31:27.680 --> 00:31:30.700
when we talked about the big data video.
00:31:30.900 --> 00:31:32.700
So here's more homework for folks.
00:31:33.240 --> 00:31:35.659
This is the perfect encapsulation
00:31:35.680 --> 00:31:39.180
of just how stuff gets so complicated for such a simple thing.
00:31:39.400 --> 00:31:42.260
So here's this 10-minute video.
00:31:42.710 --> 00:31:46.420
It tells the story of multiple mini personas throughout
00:31:46.510 --> 00:31:49.800
that we experience as software developers and data scientists and so on,
00:31:49.860 --> 00:31:51.500
trying to build tools,
00:31:52.090 --> 00:31:53.140
just a simple thing.
00:31:53.480 --> 00:31:54.640
You know, it starts with,
00:31:54.900 --> 00:31:55.220
okay,
00:31:55.500 --> 00:31:57.120
I need you to build a dashboard
00:31:57.620 --> 00:31:59.500
with a single button that does,
00:31:59.910 --> 00:32:00.400
I don't know,
00:32:00.470 --> 00:32:01.820
you know, whatever the button does,
00:32:02.000 --> 00:32:02.140
right?
00:32:02.400 --> 00:32:03.140
Pretty soon,
00:32:03.660 --> 00:32:05.400
there's this guy over the shoulder and says,
00:32:06.120 --> 00:32:11.420
what about what are you doing with a regular database you need a graph database he goes i
00:32:11.500 --> 00:32:17.860
don't need to have a graph database for 200 000 users he goes what if we had 200 000 200 000 and
00:32:18.020 --> 00:32:26.140
one users he goes gosh his delivery is genius in this one it's so good so good my highlight was the
00:32:26.200 --> 00:32:33.260
pearl guy pearl pearl you know devil shows up on his shoulder yeah it does yeah there's this this
00:32:33.280 --> 00:32:38.280
other guy's like well we need a ddd you know domain driven design bounded context for the
00:32:38.440 --> 00:32:46.220
button we need docker builds for the button it just goes on and on and just oh it is absolutely
00:32:46.300 --> 00:32:51.320
good and the pearl guy somewhere farther it is like i could have built this with a single pearl
00:32:51.540 --> 00:32:57.060
script and a cron job back in you know whenever but you portray them perfectly i mean if you've
00:32:57.140 --> 00:33:02.500
been around any amount of time in this world you're gonna you're gonna laugh yeah yeah yeah it's it's
00:33:02.520 --> 00:33:02.760
So good.
00:33:02.960 --> 00:33:03.620
So everyone,
00:33:04.580 --> 00:33:06.520
I leave you with a delightful,
00:33:08.000 --> 00:33:10.160
too realistic look at how software is built
00:33:10.220 --> 00:33:10.580
these days.
00:33:10.760 --> 00:33:10.920
Yeah.
00:33:11.180 --> 00:33:13.580
Well, this was really, really a good episode,
00:33:13.860 --> 00:33:14.060
Calvin.
00:33:14.840 --> 00:33:15.300
Like you said.
00:33:15.640 --> 00:33:15.800
Yeah.
00:33:16.000 --> 00:33:16.380
Catch you later.