Python Bytes - #230 PyMars? Yes! FLoC? No!
Episode Date: April 21, 2021Topics covered in this episode: calmcode.io Natural sort (aka natsort) Python controlling a helicopter on Mars. Pydantic, FastAPI, Typer will all run on 3.10, 3.11, and into the future * Extra, Ext...ra, Extra, Extra hear all about it* Build Python books with Jupyter-Book Extras Joke See the full show notes for this episode on the website at pythonbytes.fm/230
Transcript
Discussion (0)
Hey all, Michael here. Thank you so much for listening to this episode.
Before we jump right into it, I just want to make a quick announcement.
I'm sure you've noticed that we've talked about certain people being on the live stream or the
live chat, and I want to make sure you know how to get to that if you're interested in being part
of the show. So if you just go to pythonbytes.fm, up in the menu, there's a live stream link. Click
on that. It'll take you over to our YouTube channel where you can subscribe and get notified
about upcoming live streams. Most people just listen to the audio and that's fantastic,
but it's really cool to be able to interact with some of the audience to get that broader
perspective. So hopefully we can see you on the live stream recording sometime. Either way,
so happy to have you here. Enjoy the show. Hello and welcome to Python Bytes where we deliver
Python news and headlines directly to your
earbuds. This is episode 230, recorded April 21st, one day before Earth Day, I guess Earth Day Eve,
Brian, 2021. I'm Michael Kennedy. I'm Brian Ocken. Hi, and I'm Peter Kazarnoff. Hey, Peter,
welcome to the show. So good to have you here. Yeah, thanks so much for having me. So I work as
an instructor at Portland Community College,
and I teach engineering. And I also blog at Python for Undergrad Engineers, and I'm a book author
too. So if you're interested in like that NumPy, Jupyter, kind of Matplotlib sort of stuff,
that's the kind of stuff that I'm into. Yeah, fantastic. You do like engineering work at
the local university, right? Yeah yeah at the local community college and that includes teaching
python in our engineering programming class yeah awesome well you've spoken at the python
portland python meetup you've been on talk python to me now you're on python bytes you're making
the rounds awesome i'm excited to be here thanks Thanks for having me. Yeah, you bet.
Well, Brian, are you feeling calm today?
Feeling a little chill?
Keep calm and program in Python, right?
Right.
Yeah.
So this was suggested by Renz Demendal.
Something like that.
Cool name.
This is a site, but we've covered some of Vincent's stuff before.
This is a site by Vincent Wormerdam called comcode.io.
And what he's got is he's got a whole bunch of,
basically a whole bunch of tutorial videos on software topics.
But what I, and there are little tutorials to go with them.
I checked out the, there's a whole bunch of stuff.
There's a PyTest, there's Rich Dataset and others.
I was checking out Dataset this morning and I got kind of hooked and I watched like the
entire series because it took like 20 minutes or something like that to like watch all of
them.
It was pretty quick.
And I kind of like the minimalist, it's kind of the minimalist style.
It seems to be a balance of like like not just overview and not a deep
dive but somewhere in between and uh it's kind of a nice place to be um for and i was like kind
of blown away at how much he did with dataset just really quickly so the dataset one i started with a
csv file with a bunch of data in it, turned that into a SQLite database
with a tool that he pip installed,
used Dataset to open that,
and that opens a server on your own computer,
and then you use that to explore the data,
and then used a plugin to visualize the data
with plots and charts and stuff,
and then showed us how to actually just use raw SQL,
see what the exploration is in raw
sql and see what that looks like and then um uh and then take that take but one of the the things
is it's a it's like a little service so you could share that on your in your internal network with
somebody else uh to look at it but um the question of it's raw SQL should really let raw SQL be run.
And he said, yeah, it's fine because what Dataset does is open up the SQL database in
a read-only mode.
So you can't write anything.
So you're safe there.
You can't delete anything or anything.
Yeah, this is interesting in that it's like really intended to be 100% shared data.
And like you said, it's read-only. little bobby cables won't be a problem exactly but and then um then there's
a couple buttons that are like json or csv but they actually open up they just open up queries
and you can use those uh as a an api um into the data and you essentially have just with the dataset have had have an API that you can
use directly for some something else then and then he's like okay well what this is good enough
could you stick it out on the cloud and apparently dataset has a tool to do that and you can just go
ahead and create a docker around it with a couple commands and stick it on stick it on a cloud
service I was just blown away at how much you can do with dataset and just watching somebody play around it with a couple of commands and stick it on, stick it on a cloud service.
I was just blown away at how much you can do with data set and just watching somebody play with it is good.
And like I said,
it's not a complete data set tutorial.
It's just a scratch in the surface,
a little bit more than scratching the surface,
seeing what kicking the tires sort of video.
So it's neat.
Yeah.
Cool.
Yeah.
It seems really neat.
And there's a ton of small little tools and things you can go explore there.
So yeah, nice.
Nice, nice.
All right.
Peter, what do you think about this?
Well, I loved it.
I think this is a great resource for students too, because they're all free.
And the one I really liked was the one on SymPy, which is doing symbolic math with Python.
And that's kind of a confusing topic,
because there's a difference between using
the regular square root function that will give you
a float as an output compared to the SymPy function that
is a symbolic math representation
of a square root.
And I was hoping maybe it would be like the ASMR videos,
that there would be
very calming music while you were doing it.
Uh, but, uh, there wasn't, uh, the instruction though is really calming and really, really
good.
So I'd love to share this with students.
Yeah.
Very cool.
Very cool.
Nice.
All right.
On to the next one.
This one comes to us from Brian skin pointed out that here's a cool thing that
I don't believe we've spoken about yet. So Brian, thank you for telling us about natural sort or
nat sort. Have you guys heard of this one? No, I've never seen this before.
So one of the things that can be frustrating is if you sort with something that is really strings,
but it has some other meaning like
version numbers, like if I have a bunch of strings, and they'll have version numbers,
and I say sort that, of course, it's going to go, you know, like 2.0, then 12, then 100,
you know, or maybe 100, then 12. Like it's the way it sorts will just be, I guess, lexicographically,
it would be nice if I could just go to certain
things and say, sort it. And it automatically understood, oh, there's, there's separators,
and there's like meaning between these. And if they're numbers, you know, look at the number
part, and then sort based on the size of the number, not the whether it starts with a one
or two, but if it's a two or a 10, right? And so that's what this simple little
library does is it's simple, natural sorting in Python. So one cool example, this one actually
might be interesting for you, Peter, for your students is if I had this, a list of strings,
like quote, two feet, seven inches, one foot, five inches, five feet, two inches, and so on. If I sort it, it's just
going to go one foot, 10 feet, two feet, two feet, seven feet, right? You know, the
lexicographical version. But if you natural sort, it does exactly what humans would do.
One foot, five inches, two foot, seven inches, two foot, 11 inches, seven feet, six inches,
and so on. So that's pretty cool, right? You can just go and basically use NAT sorted
instead of sorted, right? The sorted built-in, just NAT sorted. And you could also import NAT
sorted as sorted if you wanted to go off the hook and just, you know, kind of globally replace that
on a file there. So there's different things that you can do, you know, not just that one.
You can sort versions, you can sort file paths real numbers like scientific numbers you know
1.72 times 10 to the 20th or whatever that kind of stuff um you do locale aware sorting like
basically case and sensitive sorting you can customize it you can sort custom types but then
if you select a key out of the like say a say, a class or an object, a bunch of the instances of that class, then that key would then be naturally sorted as if as this thing does.
So here's an example with versions like version dash one dot nine version dash two version dash one eleven.
And of course, it sorts the way humans would sort it right.
One nine, one ten, one eleven, then two oh and so on.
That's pretty cool. You can get a sorted
directories. Now some of these come from not the same NAT sorted, but like, for example,
there's an OS sorted and there's for the real numbers, there's an real sorted and so on. Um,
there's ways to customize it. There's ways to build like custom sorters. Like I create an
algorithm, which is like real or, and locale and ignoring case and all of these things, right? Like throw
them all together with like the, or bitwise or operator and so on. Yeah. And I think that pretty
much covers it, but it's, it's pretty neat. Uh, it has like some cool debugging stuff. Um,
ZDocs is asking if it, uh, NAT sort handles non ASCII Unicode. I think so. There is some talk
about that actually working with bytes directly, but I think it sorts on strings itself. So
I don't know why it would necessarily be different. I mean, unless you try to treat the Unicode
as binary, then that might be something else. But yeah, thanks for that.
One other thing that's interesting,
just looking through here,
I'm like, okay, this is neat.
Kind of cool.
Here's how you customize it.
Oh, wait, there's this thing called fast numbers.
Most efficient,
the most efficient sorting can be done if you install the fast numbers package,
which apparently, you know,
it has nothing to do with this, right?
But it's something that it uses.
And what fast numbers does is it allows you to have different behaviors for like float and int and stuff,
parsing strings into floats and integers. And apparently it does it faster as well. So for
example, instead of saying float of a string, that is a floating point number, you can say
fast float of that. And of course, you could go crazy and import as and wipe that out, right?
But you can do things kind of like the dictionary.get.
So you can say fast float, try to parse this.
But instead of throwing a value error, whatever type of exception it is, you can say the default
that I'm going to get if I can't parse it is zero for bad input or what number will
I treat as not a number and all sorts of interesting stuff.
So if you're doing parsing of numbers,
fast numbers is kind of cool.
Yeah, I got to check this out.
I do that all the time.
Yeah, yeah, that's cool.
So I think this is just,
that's not the main topic,
but I do think it's a neat one there.
So anyway, yeah,
people who do sorting of strings and stuff,
they should check it out.
And ZDocs is talking about like sorting,
like A umlaut over a i
don't know the name of the nice little circle above a vowel but there's the locale aware sorting
and so you can give it how um you can give it like the swedish locale uh and i bet it does
sort it okay but i don't know for sure i haven't i haven't actually tested the swedish locale but
you know that's it does seem to have like something that addresses that nice nice yeah
for me the use case uh is always the one versus zero one so if i've got something that's 10 and
something that's one uh the way that that automatically gets sorted and then uh i don't
always like putting the zeros in front uh so this seems really useful. Right. You don't have to left pad it type of thing.
Yeah.
Absolutely.
Well, how about Mars, Peter?
So how about Mars?
So this is something I'm super excited about.
The Mars Perseverance rover.
And the rover landed on Mars in February.
But just a couple of days before this recording, on March 19th,
the Mars helicopter, which is called Ingenuity, lifted off for the first time. And so this was
the first power-controlled flight on another planet, which is so cool. And you can go to the
NASA website and take a look at the Mars helicopter
lifting off for the first time.
It's kind of got two counter-rotating rotors
and a little solar panel up at the top
and a little antenna up at the top.
And the cool thing about this
is that some of the software
that's running the Mars helicopter is built with Python.
It's also totally open source.
So on GitHub, there's this package for something called F Prime, and NASA writes it F apostrophe. And F prime is the flight control software that the Mars helicopter uses. And if you look at the GitHub repo, you'll notice in the installation instructions that you have to make sure that you have Python 3 and pip installed in order to install f prime the mars helicopter software so i just think that
that's super super neat that python's being used as part of the mars mission and that open source
to make this f prime flight software was used in order to make this happen. So Brian, you excited about space and
the Mars rover? Yeah. And also one of the things that happened with this is GitHub put a bunch of
achievement awards on it, a whole bunch of people's GitHub accounts to anybody that contributed to a project that was used by f prime um and
and it may have been other packages too but at the very least with this and so a bunch of us got
these like uh you know you contributed to the mars helicopter mars mission thing so yeah i felt
cool being an arctic code vault contributor and now that's that's just out of this world, man.
It's awesome.
Yeah.
Yeah, I love in that post how they showed like a screen capture for Marietta, one of the core devs, and showed like her little shield.
So I thought that that was awesome.
Yeah.
Yeah, that's really cool.
Yeah.
Sam Morley also called that out that she got a badge for contributing to the helicopter.
Yeah. Sam Morley also called that out, that she got a badge for contributing to the helicopter. Yeah.
And apparently, I got one for contributing to PyTest, which is cool.
So I didn't know PyTest was used by this, but that's neat.
No kidding.
You have one of these badges?
Yeah.
Let me pull it up.
Oh, my gosh.
Oh, that is so awesome.
That is super cool.
Yeah.
And while you're pulling it up, ZDoc says, super amazing, great work by NASA.
Crazy that Python is considered stable enough
to be used by them.
I totally agree.
Oh, where is it?
There it is.
Oh my gosh, you have the badge.
Dude, I am so jealous.
It's pretty cool.
Yeah, that's really cool.
So one of the things I was going to talk about
is some extra, extra, extra stuff.
But two of those have to do a
little bit with like what we're talking about now so i'll mention them in a moment so um aram
mentions on twitter that um uh points out for us there's this quote from dustin ingram who runs
the ipi along with some other folks and says python packaging sucks in sort of quotes but
now it sucks on multiple planets, which is pretty awesome.
And then it goes off on this long, like this, he goes for a long thread of like how it's being used, what it's being used with.
And I link to this in the show notes.
There's like a ton of stuff you can follow along there. And then also, a lot of work points to an article over here that talks about this badge that you were referring to, Brian, and the various people who are getting it and the repositories that qualified for it. So Linux, F prime, C Python,
Boto3, BotoCore. See what else jumps out at me. That's Python, a matplotlib, NumPy, OpenCV,
Python, Python date util, requests. Yeah, I saw Kenneth Wright saying how humble he was to see
that. S3 transfer, which I use. I mean the list
is like, this is a list on GitHub
but this is actually like a list of many of the
big hitters of Python. It talks just about
hints at how important Python is
for this whole mission.
It's awesome. Yeah, that's great.
Cool. Yeah, absolutely.
Absolutely. Super cool.
I guess real quick before we
move on to the next thing, just point out that this episode is brought to you by us. So if you want to support us, check out the things that we're doing, like check out the TalkPython training courses, check out Python, Brian's PyTest book and things like that. And yeah, Anthony Lister gives you a little shout out there. Well brian you're basically you're basically basically an
astronaut you know what i mean well it's and it's like i'm almost embarrassed though because i i
like i contributed one test to a defect report a defect report and then wrote the test to to show
the the defect that was my contribution to pi test but yeah but yeah. All right. That's okay. It's all good.
Cool.
All right.
Take us back to Earth.
Well, let's, so we, there's a lot of cool projects in Python. One of the cool projects is FastAPI, and that's built on Pydantic.
And Pydantic's used by itself for lots of stuff.
And anyway, why am I talking about this?
Well, one, it's cool, but we've talked about it before.
But this topic was, we've been following it anyway,
but I got to give a shout out to the person's name
that mentioned it to us.
Somebody named Angry Dwarf said we should cover it.
And I just love that he had his name
and his email was Angry Dwarf.
So cool.
Thanks, Angry Dwarf.
Anyway, it's been a bit of an emotional roller
coaster, but the punchline is Pydantic, FastAPI and Typer will work just fine in 3.10 and they'll
work in 3.11 and they'll always work. They're going to work forever. I mean, I don't know that
for sure, but that's my, that's my guess. So why am I saying that people should calm down and it's
going to be fine? Because people were freaking out last week.
So people were freaking out that maybe fast API and Pydantic weren't going to work in 3.10.
Including the creator of Pydantic, not just random people on the internet.
Oh, really?
People involved in the projects.
Yeah, yeah.
They were like, this is going to be not good.
Okay.
So this starts, okay, I'll jump into a little bit of the details.
There's a PEP 563 that was titled Postponed Evaluation of Annotations.
And there was a little bit in there, and this went into Python 3.7.
And this said, it went into 3.7, but there was a clause in there that said in Python 3.10, the functions and variable annotations will no longer be evaluated at definition time.
They'll be lazy evaluated later or something like that.
I didn't read it that closely, but that the bit that that makes people scared about 310 and
310 is coming out like really pretty soon so um does that mean that pidentic and uh in best api
they kind of rely on this and they're not are they not going to work in 310 um and it turns out there
was some corner cases there was at least that's my understanding of it. Sebastian Ramirez, who did FastAPI,
he wrote,
there's been some incorrect conclusions
that FastAPI and Pydentic can't be used with 310.
Let's clear that up.
The worst case scenario,
which hasn't been decided,
is that some corner cases would not work
and require small refactors. And then he goes work and require small refactors.
So the, and then he goes on to show the refactors.
So the refactors really are just there that if you define your types within a function,
they can't, you won't be able to do that.
You got to pull the types out of the function and put it at a top level or something like that.
And even if you're stressed about this, you can try it out by saying in the code you have,
you can say from Dunder future import annotations, and that will show you what the future implementation
is.
So you can try it out and see if there's any problem.
But then we got, and I don't have a link to this, but we had a notice from, who is it from?
I'm missing the name.
Anyway, a notice just the other day that basically said they're not going to do it for 310.
So basically they're putting the brakes on 563, the switch over in 310 for 310.
They're going to push that to 311 so that they all have time to figure out
what to do about it and how to figure it out.
So they got another year to figure out
what's, or approximately.
As users, I have another year to not worry about it.
But the steering council, they know what they're doing.
They're aware of this.
They're aware of this issue.
They're aware that everybody loves FastAPI of this issue. They're aware of the,
that everybody loves fast API and Pydantic and things that are built on that.
So there's going to be a solution.
And I think people should just trust the people involved that things are
going to be okay.
So anyway.
Yeah.
It's there's a really,
what's the rightydantic issue tracker, and it just closed a little bit.
Just a little bit.
The last six days just recently closed, which is good.
But it was basically important PEP 563 and, 9 in the future of Pydantic. And I just had Samuel
Colvin, who is the creator and maintainer of Pydantic on TalkPython. That episode should be
out this week, actually. But on there, he talked about how some things looked very bad for how
things work, but then they've talked it through and it looks like some of the changes are not
going to be super significant. Basically, the problem was a lot of the type annotation evaluation is no longer concrete types like a
Python type. You go to the and say, give me your type. What are you? It was converting those to
strings so that they could be evaluated more quickly. But then in doing so, if I have a string
called customer, that's very different than having the actual customer class that I can then use for type information.
So then how does Pydantic go back and find the customer class throughout all the things?
What if there's two of them?
And so on.
So that was the concern.
And it sounds like things are looking better.
So that's all good.
So Brian, what's kind of the take-home message of this?
Well, one of the things, I don't know, my take-home message is the people involved,
like Samuel and Sebastian and the steering council, they're talking with each other.
They know what's going on. And occasionally, stress happens as to what's going to, you know,
I don't know how to fix this. But they're talking with it. I'm going to try as a, as a bystander, I'm not going to jump on the bandwagon and try to like, one of the things that came out
was people, some people started sending a bunch of emails and jumping on the thread saying, you
have to fix this, you have to fix this. And that doesn't help. It just adds noise and adds work to
the steering council. So making, I think it's fine to make sure that it's addressed, but
it's going to be addressed. And I don't know, I, I actually was one of the people, cause I,
I use fast API. I use typer and I was like, uh, do I need to be worried about this? And,
and especially somebody using it, just take a deep breath and realize that something as large
as fast API or pydantic is somebody's going to figure out how to fix it.
Hopefully.
I mean, it's possible that something might break.
I mean, it is the dynamic language.
There's enough people paying attention that, I don't know, that's probably a long-winded takeaway.
It's like a repeat of what I just said.
But anyway.
So if you're using FastAPI right now, there's not a whole of what I just said, but anyway. So if you're using fast API right now,
there's not a whole lot to be worried about.
Nothing to be worried at all.
And if you are worried about it at all,
you can use this future import thing
to try out your code to see what it'll be like in the change.
And even if that breaks,
they'll probably fix it by 3.11.
Yep.
And then, yeah, Nick Harvey threw out
that you can test this from future, under future right now. So that's11. Yep. And then, yeah, Nick Harvey threw out that you can test this from future, Dunder future
right now.
So that's cool.
Yep.
Cool.
All right, Brian.
I tried to keep it down to just a couple of things, but then they started piling up in
my extra section to where, I don't know, we wouldn't be getting through it in a reasonable
amount of time.
So welcome to another section of extra, extra, extra, extra here all about it, but minus
one extra, because I already told you about it, but minus one extra because
I already told you about the one with the package list and so on. All right. So let me take you
through a couple of things. First, here. Did you know we're live streaming right now, by the way,
on PythonBytes.fm. Hello. On PythonBytes.fm. I say that because there's a huge banner on the site
I pulled up. We had something that would let us get some real-time analytics and sort of know where
people are coming from.
You know, advertisers sometimes ask for that.
But what I've noticed is a lot of the new browsers, a lot of the good ones anyway,
are very much blocking those things, right?
So for example, Firefox automatically blocks our analytics anyway.
Brave automatically blocks our analytics anyway. Brave automatically blocks our analytics anyway.
So we're not getting a lot of information back and we're getting, I don't know, my theory is
about 40% of the traffic is being measured, which gives you some stuff like what countries people
are coming from and whatnot. But I decided, you know what? We already have our ads, like in our
ads, we do no tracking, no retargeting, no cookie setting and so on. So why don't we just do that
with our analytics? Like we don't, how much do we really need that? Anyway, we got downloads and so on.
So if you go over here, and you click on the little shield, we now have a perfect
privacy score on Python bytes. Oh, very cool. Check this out. Tracking content,
none detected. No social media, no cross site, no fingerprinters, no crypto miners,
nothing. And same, by the way, for TalkPython
training and TalkPython itself and so on. No known trackers to Firefox were detected on this page.
Cool, huh? Yeah. I didn't know about that little badge thing.
Yeah. It's like a security score. Like how much is blocked? How bad is it?
And so on. But because so many of them are blocking them by default, I'm like, you know,
like, let's just take this stuff off. Right. It's somewhat useful, but not that useful.
Related to that.
Have you heard of this Flock federated learning of cohorts?
Have either you heard of this?
No.
No.
I'm worried that joke is coming now.
No, this is this is just Orwellian business right here.
Like it has this eye looking at you.
So there's an article on Ars Technica.
Everybody hates flock.
Google's tracking plan for Chrome ads.
The EFF has a beautiful article that you really should read if you at all care about the future
of the web, the future of tracking the future of privacy called Google's flock is a terrible
idea from the EFF.
And they've got some pretty insane quotes in there. For example,
one of them from the EFF is Google's pitch to privacy advocates. I'll tell you what Flock is
in just a second. But Google's pitch to privacy advocates is a world with Flock, is that the world
with Flock will be better than a world that we have today where data brokers and ad tech giants
can track and profile with impunity. But that framing is based
on a false premise that we have to choose between old tracking and new tracking. It's not either or
we can reinvent the world where we're not being tracked in every way and sliced and diced and so
on. And I totally concur with that statement. So yeah, check this thing out. This Google's
block is a terrible idea. The idea is instead of having third party cookies, which so if I go to cnn.com, you know, we could
try that. It probably won't show up here because I have it blocked at like a higher level. So now
it's not showing up here how many things get blocked. But anyway, if you would go there,
very likely they would set a cookie from say, double click that you saw this ad, uh, not this ad that you saw this article.
Then you go over to, uh, I don't know your dentist or, or your psychologist or whatever.
And then they also can have this thing. So they actually were just reading this article basically,
right? Like they can, they can profile what type of person you are very, very fine grained through
these cookies. So flock, you know, basically Google said they're going to get rid of these
cookies because as I already pointed out, everyone's blocking these third-party cookies,
Firefox, Brave, VPNs, and so on. So what do you do to keep the ad retargeting happy and the,
like the super analysis of what everyone's doing happy? You come up with a new idea. The idea is
your browser is going to use machine learning to put you into these cohorts. Like, are you a young female lesbian? Are you a divorcee woman in her forties? Like what group are you in?
And then every advertiser that you visit can basically receive like, Oh, what, what kind
of person? Oh, this is a divorcee who's coming. Even if they've never been to your site or
anything, right? They, they, you sort of get your flock advertised to you your
your um group it's not private data but it's pretty private right it's it's like this group
it means a lot anyway i thought that this was a pretty big deal on the web and people should
check it out so i put that out there um for for you all to consider what do you think like tracking
is a terrible idea and it's mean too i don don't have the link to it, but I was reading an article recently about how somebody had,
I don't know, they were expecting a baby.
So they were looking up all sorts of baby stuff and then they lost the baby with the
miscarriage and they still got tracked for that.
And so they get, they get stuff.
And then somebody, a couple of stores figured out what their address was and figured out when the due date probably was.
And then they get like they keep getting these things like your child's probably about four now.
Maybe they need a bike.
And that's terrible.
Yeah.
So, yeah.
Yeah.
But here's here's part of the thing.
All this is not so good.
Right.
Like, I mean, they're both not good.
But how do you clear your flock? Right. Like hit command shift delete and clear my history my cookies how do
you clear out your flock like you're just no you're just a divorcee and it's recomputed every
week so like it goes like you could actually track like the stages of somebody's life the
different groups they've been it's it's super bad news so anyway i don't need this we don't need it
at all i mean we don't yeah we don't need it at all. We don't.
Yeah, we don't need it at all.
People did advertising in magazines and newspapers for a really long time with no tracking.
Yep, yep.
And as I've already pointed out, so do we.
Not in newspapers, but nonetheless.
Yeah, so anyway, people should check this out.
That's worth pointing out.
And then also kind of related to that,
I recently started using NordVPN, and it's not an ad. I know they sponsor a lot of podcasts but that's not that i just started using it it's
super cool you can set this up to automatically like when you log in just join your vpn like i go
to seattle right now and it also it does all that cookie blocking and all those different kinds of
things like automatically at the network level.
So now, for example, it automatically does that when I turn on my iPhone, it's just always on the VPN.
And if I fire up an app that doesn't allow ad blocking,
that app is already blocking ads
because the ads are blocked at the network level.
So for example, I've used like Flipboard or like Apple News,
like the ads are blocked.
So anyway, that's worth throwing out there.
And yeah, that's all my extras,
but kind of a privacy intensive one,
but I thought they'd all kind of go together well.
So I ended up making that a thing.
And then Alexander Siminov says,
I believe that human classifier trackers will backfire.
Yeah, I think there's a lot.
I agree with you, Alexander.
And I think there's a lot of negative effects.
Like for example, you can target
and disadvantage marginalized groups. And Google actually talks about like when they detect
that enough marginalized groups have been harmed, they'll recompute the flock. It's like enough.
Yes. Yeah, exactly. It's really Orwellian. Uh, I'm not, you know, trying to be hyperbolic when
I say that like actually is. So, um, people should check that out and just be hyperbolic when I say that. It actually is. So people should check
that out and just be aware. And yeah. Peter, you want to talk about your last item here?
Jupyter Book. Yeah, I'd love to talk about Jupyter Book. So there are a lot of static
site generators for Python as well as for other languages. So this is like a good party game. How many static site
generators can you list? Like Sphinx, Pelican, MKDocs. Do you have any other ones off the top
of your head, Michael? Oh, I think probably, is Ghost one? I think Ghost might be one.
Like Hugo, all of those. But I do a lot of my work in Jupyter Notebooks. And when I'm working with students,
a lot of our notes are in Jupyter Notebooks. And this package called Jupyter-Book is a Python
package that allows you to take Jupyter Notebooks and build static sites out of them. And primarily it's designed so that you can...
That's cool.
Yeah.
You can build free online books based on Jupyter notebooks,
but also markdown files.
So I've got like a little book going.
You could almost put like a little scientific website
that has some like analysis and various things.
You could kind of put that together as a series of notebooks and publish it, right? Yeah. Yeah. And you can even do it with
interactivity too. So this is part of the executable books project. And kind of the idea
is that you'll be able to interact with things like plots if you make them with Bokeh or Altair.
And the code output that you see in the Jupyter Notebook,
that actually came from the code that was written in the Jupyter Notebook.
And I think that's pretty neat as well.
And on the docs, there's this way that you can automatically deploy your book to GitHub pages for free,
which I think is really nice.
And then there's also a GitHub so that you can hook into GitHub and then automatically
every time that you push, your book gets republished.
So every time you change that notebook and you push up to GitHub, uh your book gets republished um so every time you change that notebook and you
push up to github now your book gets republished with all of your new content uh and i think that
that's really really neat allows you to make like revisions and publish uh super easily um so the
that's cool and you could probably you could probably put it on a specific branch right so
if you like you make all your changes and then you're ready to push out the next version of the book, you could push to the main deploy branch or whatever.
Yeah, yeah.
I mean, in your GitHub action, you could set whichever branch you want is the one that kicks off the action that builds your book.
One thing I'm kind of interested in is could we make a GitHub action
that would kick off a build of the PDF of your book? And then you could have like a releases
page where it would be like the PDF if people wanted to print it out or, you know, kind of had
more of a hard copy of it. I think that's pretty cool. And like the book gallery that they have,
they've got some awesome titles that they have listed,
like Geographic Data Science with Python.
That sounds interesting.
Quantitative Economics with Python.
The UW Data Visualization Curriculums
from the University of Washington.
How to use a lot of Python plotting tools.
Oh yeah, this looks super like it came out of Jupyter,
but it's a legit website.
It has a read the docs type of feel.
Yeah, yeah, definitely.
And up in the right-hand corner of these,
you've got these buttons that you could like download a PDF
or download the notebook.
You can launch a Binder instance so that you could like
run that Jupyter notebook. And you can have a default button that'll automatically take you to
GitHub where that notebook is hosted. So it's pretty slick, I think.
Yeah, this is super cool. Brian, as a book author, what do you think?
Well, it's one of the things that confused me when I was thinking about this is,
and it did with Jupiter Notebook in the first place,
is what does a book mean if it's not a book?
I mean, this idea of a book, it's not a book anymore.
It's something else.
I never really got it, why Jupiter Notebooks went to the,
I don't get the tie in between book and
book, but maybe somebody can explain it to me. Yeah, I mean, it's sort of blurring that
release line that it's officially version one of the book and version two of the book. If you do it,
every single push is a new version, then it's sort of like just rolling like CICD book release, which I think is kind of neat.
But in my area, teaching engineering, textbook costs are huge. Textbooks can cost hundreds of
dollars for college students. So if there's a way that we can make a lot of open education
resources books, I think that that would be great for college students.
I really like the design of having the table of contents on the left of the book. And then
on the right, there's the contents of the individual page. So you can jump to it. That's
a really cool idea. I actually, I was joking a little bit. I really think that would be cool if
maybe it already does this, but if there's a way to turn one of these into an e-book or a PDF from this.
Yeah, where's the Kindle version of this?
Yeah, exactly. And I'm not even joking. I think a lot of these sorts of things would be great to be able to throw onto a kindle to be able to walk
around and read so yeah yeah you can definitely output pdfs and latex documents uh with it but i
don't know about uh like kindle ebook uh format uh maybe somebody can like write that in and uh
give them a contribution that'd be cool yeah Yeah, for sure. Sam Morley says, having free interactive
coding textbooks would be a real game changer
for a lot of people, particularly if somebody
figures out how to make this
portable to mobile devices.
Yeah, for sure.
A couple other comments also from
Sam. He says,
congrats, Brian, about your badge.
Nice to know that NASA does test their
software. I bet they test that NASA does test their software.
I bet they test the heck out of that software.
Before you send it up, it's got to get tested.
Maybe to a fault.
I don't know.
But it's got to get really, really tested.
And then also, just while I'm in the comments, James Abel.
Hey, James.
Says, and Mike will be presenting at the Python meetup tonight. Yeah, I didn't necessarily think to cover this because it's so close to
six hours from when I'll be presenting.
But yeah, I will be doing
a fun memory deep dive
sort of live coding type of thing over there
at the Python meetup in San Francisco
virtually because that's the world
we live in. But yeah. Nice.
Very cool. Yeah. And then John Sheehan
says, it's a short hop from LaTeX
to EPUB with Pandoc. Yeah. And then John Sheehan says, it's a short hop from LaTeX to EPUB with Pandoc.
Oh.
Oh, yeah.
Yeah, you may all be right there.
Right there.
All right.
Well, I did my extra section already.
Brian, you got anything else you want to do?
A quick shout out to?
Yeah.
Speaking of virtual, Python, the PyCon ZA,
the South African PyCon is coming up.
I want to shout out to them.
I don't have a link to them up here,
but it's a conference that's going to be on the 7th and 8th of October.
It'll be entirely online.
And I was just curious because it sounds like I was curious about the whole virtualness.
It's a little bit early in the morning for us,
but they are, so I had a little bit of an email exchange.
They are going to be able to have some prerecorded,
so you can prerecord your talk if you want to.
So if you're afraid of doing it live in the middle of the night,
don't worry about that, but you can submit anyway.
And they're allowed, but they'd like to have the author be live while it's playing so they can submit anyway and uh and they're they're allowed but they'd like to have
the the author be live while it's playing so they can answer questions and stuff and that seems fair
um the second update is last week we covered dead dependency or dead dead dependency i don't i don't
know how to say that dependencies i don't know um and, so one of the things we said was it's too
bad that it doesn't cover, it doesn't do pipe project.toml in within a day it was, it was,
uh, supporting it. So, um, the, the, there was an update the next very next day that, uh, it
supports, uh, both flit and poetry with pipe project.toml. And since it's doing pipe project at Tomo,
I imagine it to do a setup tools as well.
If you're doing pipe project at Tomo setup tools.
So that's so awesome.
Well done folks about updating that straight away.
I mean,
isn't it amazing Brian we'll talk about random things like this is cool,
but,
and then like the next day we get,
so like the dead dependencies folks fix,
you know, added pipe project at Tomo support. I talked about being as though it needs a way to have indexes next episode we get, so like the dead dependencies folks fixed, you know, added by projects.toml
support.
I talked about being as though it needs a way to have indexes next episode.
Oh, here they, they heard us and they added indexing features and so on.
Part of it's the podcast.
And also part of it is, uh, since I'm doing research for the podcast, I just reach out
to people more often and say, I'm, I, this is a cool project, but it doesn't do this.
Is there plans to do that?
And you'll, I mean, project owners
love to hear back from people.
And even if I wasn't,
I think other people should do that more often.
Don't just complain about something.
Ask somebody if it's going to be supported
or if you can help out.
So, yeah, absolutely.
Peter, anything you want to throw out there?
Any little extras?
Tell people how they can find your book or something like that?
Yeah, if you search for problem solving with Python on Amazon,
or there's a free open education resources version online too.
And one little shout out I got is our community college is looking into
how to integrate artificial intelligence into curriculum.
So if anybody's in the Portland area that does AI stuff, reach out to me.
And I'd love to talk to you about how we can integrate AI into community colleges.
Oh, yeah, that'd be really cool.
Yeah, it's a super fun project.
Awesome. It does sound fun.
You know, ready for a joke.
This is a team effort here.
Yeah.
I'm going to close the other tabs.
There we go.
So that's a little large.
This is again,
one of these funny code comments.
Uh,
I guess I'll go last Brian,
you want to do,
uh,
Oh,
let's have Peter go do the first one.
So these are,
these are from,
uh,
comments that were found in real code,
supposedly.
Uh,
and then they're just kind of funny.
Peter,
you want to do a first comment
or all right our first our first comment is dear future me please forgive me i can't even begin to
express how sorry i am and here we go that's great all right brian this is one that um i don't know
it's here to take on the optimist i don't't know. What would you, I'm not sure how you put this, but it's a exception handling block.
What do we got?
Okay.
So yeah, a try block with a catch SQL exception and a comment that says, basically, without
saying too much, you're screwed royally and totally.
And then, and then another catch exception, like a raw exception, says, if you thought you were screwed before, boy, have I got news for you.
That was my favorite.
That was so good.
And I'll just close it out with one of these ones where you just kind of have to accept life, I guess.
And it says, this is crap code, but it 3M, and I need to get it working.
Yeah.
Oh, boy.
Okay.
I wanted to share one more.
All right.
Because I was talking with my coworkers the other day, and somebody actually mentioned how hard we had a problem with cache invalidation and it reminded
me of that old joke of uh there's only two hard things in computer science cache invalidation and
naming things um and so i went to look it up and then i found this uh this other joke um there's
two hard problems in computer science we only have one joke and it's not funny oh that's great i love it i love it all right uh we'll round it
out with uh nick harvey here says exceptions while handling exceptions are just the best
indeed they are yes indeed they are all right well brian it's great to chat with you and talk
by done things as always good to talk to you yeah and peter thanks for joining us this time
thanks for having me yeah great to have you on the show bye everyone bye