Python Bytes - #175 Python string theory with superstring.py
Episode Date: April 1, 2020Topics covered in this episode: * Quick chat about COVID 19.* Dictionary Merging and Updating in Python 3.9 superstring New pip resolver to roll out this year Why does all() return True if the iter...able is empty? pytest-monitor Extras Joke See the full show notes for this episode on the website at pythonbytes.fm/175
Transcript
Discussion (0)
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 175, recorded March 26, 2020.
I'm Michael Kennedy.
And I'm Brian Ocken.
Brian, we have a special guest.
Welcome, Matt Harrison. How are you doing, man? Glad to have you here.
Good. Good. Thanks for coming on.
Yeah. It's always nice to have you on the show.
Before we get into it, let me just tell you this episode is sponsored by Datadog.
Check them out at pythonbytes.fm slash datadog.
I'll tell you more stuff about them later.
First, I want to just throw this out to both of you guys.
The world is, I don't know, is it turned upside down or is it locked down?
Or what has gone on with the world?
It's crazy.
We're kind of software people, and I know we're all kind of in different boats.
I am definitely grateful
that i'm a software person i have a lot of a lot of friends that are not that are in the retail
industry or the selling stuff to people sort of industry or self-employed and those people
they're really hurting i've got a lot of people i know that if they're self-employed you don't
qualify for like uh unemployment insurance and stuff.
So there's a lot of people hurting them.
How are you guys?
It's crazy.
Yeah.
Matt, how about you?
I just found out this morning that my largest client just dropped all my trainings for the
rest of the year.
That's not your favorite phone call or email to receive, is it?
Not the best news.
But the thought that I have on that is is like past couple years have been very good
right and people have said like the bubble will burst and i don't know that we thought that a
virus would do this but i mean it looks like winter came for better for worse and so people
are going to have to adapt and it now if you can weather the storm it might it's going to be tough
though i mean i i was even talking with some friends who are in the medical industry, and they're
like, we're worried about our jobs, right?
And these are like doctors and people who work at the hospital.
So it's interesting to see what's going on.
And I've worked from home for the good portion of the last 15 years.
And right now, it's scary to see that there's a lot of upheaval and we'll see what
happens. How are things going for you, Michael? Well, you know what? It's really interesting.
If you'd asked me this question like six years ago when I was doing mostly in-person training,
it would have been like somebody just cut the light switch off and said, you know,
we're all leaving. Lock the door on your way out, right? It would have been purely traumatic.
Luckily now, like online courses are great still.
Podcasting is great.
Like what's ironic is my work life is literally unchanged,
but the rest of my life is scrambled, right?
Like my daughter's home from school because they closed school.
Like Oregon's now on full lockdown.
Like it's hard
to go out to dinner. So everything has changed in some ways, but ironically, not my work life,
really. I'm sure it'll have some effect eventually, but nothing immediate. I guess one more thing
before we move off. I'm just curious, what are your plans around training? Are you going to be
teaching over Zoom or is it just focus on other stuff until it comes back? Yeah, I think both of
that. I do have some clients who are moving to virtual training
and I already do a bunch of virtual training anyway.
So, I mean, it's sad that some of them aren't able to
or can't due to circumstances or whatnot,
but try and see if other people want virtual training
and just work on other products
that people are interested in as well.
Yeah, absolutely.
Well,
thank you to all of you guys and everyone out there.
It's going to be a wild ride and hopefully the software side of the world is a little bit less bumpy
but still, it's crazy.
Alright, well, let's
talk a little bit about the future, Brian.
We can't predict when the COVID
stuff is going to be better but you could probably
predict some stuff about the Python future.
I'm just still getting excited. I'm used to being able to have Python 3.8 everywhere.
But we've got Python 3.9 right around the corner.
And October is the scheduled release.
I don't know if that'll change due to the virus or not, but that's where it is.
And one of the cool things that I noticed from a blog article is that there's union operators
coming for dictionaries in Python 3.9 and this is PEP 584 and there's an article called
Dictionary Merging and Updating in Python 3.9 by I think Yong Kui and there's a couple new
operators one of them it's just the the bar or the bar equals or the pipe operator, whatever.
Looks normal for if you're used to, I guess that's the math or operator.
It's like a bitwise or like a bitwise or yeah.
I'm kind of excited about it.
So you can combine two dictionaries by just doing like a dictionary one or dictionary D2 or dictionary two or something like that. And then the equivalent
assignment operator as well, which is really an update operator and a merge.
The article spent a little bit of time talking about the other older methods that you can use
to combine dictionaries now. And I know people have covered those in a lot of places. The one
thing, the article actually spent a lot of time on it,
and I just think it's something to watch out for and be aware of,
is when you're combining dictionaries, usually if there's overlapping values,
like if there's a value with the same key in both dictionaries,
you'll get the second one will take precedence.
It's just something to be aware of.
Yeah, and that's the way it works in the current operators as operators as well right the star star sort of combined stuff and whatnot yeah as long as you're
aware of it it's good to know but this is clean it's actually something that now that i see it
i'm surprised that we don't already have a uh an operator already in ticket mine dictionaries
because it's something i kind of do a lot of so yeah and if you look at the syntax there for the pipe I mean the pipe is already in the set operator and prior to sets existing when people used to use dictionaries
to emulate sets I mean they wouldn't do the or operator but but it's it's interesting that sort
of coming around circle now that we originally had dictionaries people started using dictionaries as
a simple replacement for sets then we got got sets, which had the pipe operator,
and now the pipe is coming back to the dictionary.
Interesting.
So why do you guys think they didn't use plus?
Like, you want to combine two things, like two lists.
You don't use a pipe to put them together.
You use a plus.
For strings, you use a plus.
Plus already existed.
I think it's because of the union operator already being used for sets.
Yeah, you think so?
Yeah.
All right, cool.
Well, yeah, it's good to see some nice shorthands coming there.
But if we can have a pipe equals operator, give me the plus plus.
Come on.
I just want the plus plus.
Double pipe.
Yeah, double pipe.
What does that mean?
All right, Matt, you got the next one.
This one is short and sweet, but it looks pretty cool if you've got the use case for it. Yeah, double five. What does that mean? All right, Matt, you got the next one. This one is short and sweet, but it looks pretty cool.
You got the use case for it.
Yeah, so there is this super string library,
which is a new library that's a replacement of,
well, not a replacement, but it's a new string library
for holding sequences of characters.
It's built on this rope data structure,
and apparently it's pretty optimized.
It uses a 20th the amount of memory and a fifth the speed.
So operates five times faster for a lot of operations.
I think this could be super useful for people who are manipulating data.
So it'd be interesting to look at,
you know, if the people who are doing NLP
could take advantage of this.
Definitely like the memory constraints,
you know, using a 20th,
the amount of memory would be awesome.
Even in places like pandas,
NLP as well, natural language processing.
The API is pretty basic right now.
It's got concatenation, getting to the length,
doing some indexing and slicing and stripping
and uppercasing and lowercasing.
So that could be a good,
with the speed and memory performance they're showing,
that could be a good enough limited set of capabilities.
Sort of for me, the elephant in the room is the F string.
For me, that's the best feature of python 3
i know implement that and uh let's use it yeah the other thing that's missing is uh negative indexes
but that can't be hard to add honestly maybe it's hard to add quickly but it can't be hard to add
negative indexing that's a good point i mean they don't make any reference to whether they support Unicode. So that's, I guess, another question, right? If they do support the Unicode
capabilities, the Python supporting, I mean, Unicode can make indexing a little bit more
complicated, but that might be what's going on there. But this will be interesting to watch,
interesting library to watch. What do you think think brian i'm just not in a place
where the strings strings are the memory or the like the bottleneck in my any of my applications
so yeah yeah but to give you an example like a real world example like i've been playing with
some markdown stuff for like the sort of cms side of things that i'm writing in markdown
and if you've got something that's maybe 10, 20 pages of Markdown, it takes half a
second to convert that from Markdown to HTML. I don't know how much of that is like the actual
string juggling and how much of that is just converting it to Markdown is slow, but that's
a non-trivial amount of processing that's like sort of around the corner. I mean, you would never
do it manually. You would use a library, right? But still, you could benefit from that.
On that, you can think of all the people who are using static libraries for web pages.
They all complain about once you get X number of pages in there, they start getting slow,
and the rebuild takes five seconds instead of a half a second or whatever, right?
And so something like this could help there as well.
Right, theoretically. So this is not a super popular library, but? And so something like this could help there as well. Right, theoretically.
So this is not a super popular library,
but I'm glad you put it on here
because I think it's pretty cool.
I guess two thoughts.
One, it'd be interesting to look at what they're doing
and if there's any easy low-hanging fruit
to bring back to CPython
because it would be better
if just Python strings were faster
and they're like, why would you make this?
It's the same speed, you know what I mean?
Then the other, Brian, you may may have noticed there's no tests oh
yeah it looks like it's recent it's like i don't know if it's even been around for
more than a week so yeah i think it's pretty new so if somebody's like oh this is cool let me try
it out like maybe a way you could participate is like write some tests just to verify things right
but uh yeah pretty cool it's just imaginary if there no test, it's like no picture, no proof, man.
If it continuously deployed in the woods
and there were no tests to hear it,
did it actually happen, something like that?
Yeah, yeah, exactly.
Sure, that's the saying, I think, the historical version.
I thought your new testing strategy
is if it doesn't have tests and you don't commit it.
Didn't you say you're using something like that?
Yeah, that's good.
Yeah, that's a good way for sure.
All right, so this next one is going to affect everybody who works with Python.
This is a big deal.
Hopefully it's not a bumpy deal, but it's a big deal.
So the Python Packaging Authority folks, the PSF subgroup,
they recently got funding to hire some developers
to make pip better.
So pip is awesome.
We all pip things.
And even if you don't pip things,
if you pip them or you poetry them,
you really pip them down below, right?
So they got a bunch of funding to make that better.
And one of the challenges,
one of the first challenges that they're tackling is that PIP, well, it doesn't take into account all the stuff you're trying to do.
It just says, I see a requirements file.
Let me just go from top to bottom, just start hitting it, right?
Install the first one, install the second one.
So they're rolling out a new PIP resolver at the end of the year.
That's pretty cool, huh?
Yeah, this is neat.
Yeah, so the idea is basically it's going to go
and it's going to look at the dependencies of the various packages
and try to install something that is consistent across all of them.
Like maybe the first package in your requirements file requires,
I don't know, docutils 16,
and the second one requires docutils 15, or maybe the first one
doesn't even specify and 16 is just the latest. If you pip install dash R that, you're going to get
16. And then it's going to complain that you have 16 and not 15. You know what I mean? It's like,
it just doesn't even factor in the larger system that these two things have to coexist. So that's
one of the things they're working on. So to reduce inconsistency, it'll no longer install a combination of packages that's mutually inconsistent.
And it will be no pushover. It's going to be strict. If you ask it to install two packages
with incompatible requirements, it will say no. It will not do it.
Yeah. And then it just doesn't install anything, I think.
Yeah. Yeah. It just says, no, I can't install it.
That might cause some problems, right?
Yeah, it might.
Or make people's processes work differently.
Because, I mean, right now I know there's a bunch of libraries on top of each other.
And I can sort of just install them over on top of it.
I have my libraries, and some of them sort of work, and some of them doesn't refuse just install them over on top. I have my libraries and some of them sort of work
and some of them doesn't refuse to install them.
So this might be a speed bump in the road for a lot of people.
And maybe in the end, it works out better,
but might cause some consternation in the short term.
Yeah, that was my first thought exactly.
It's like, oh, there's going to be a bunch of stuff
that just won't install anymore.
Maybe a library itself can't install because two of its base
libraries' dependencies themselves
are inconsistent. How are they working
now then? You just get a warning and it just still works.
It's not that they're necessarily
truly inconsistent.
One says, I require library
less than equal to this version. Another one says,
I require library greater than equal to that version.
That doesn't necessarily
mean the one that requires
the lower one wouldn't work with the newer one.
It's just that's what the requirements state.
You know what I mean? Like, for example,
Bodo 3, which
is the Python 3 library if we're talking to AWS,
in its underlying library,
Bodo core, at
one point were having different
dependency, like inconsistent dependency
statements or something weird like that that i was running into but it didn't matter it still ran i'm
just like oh i better run the unit test it says these aren't going to work together let's see if
they you know like maybe there's some corner of that thing that doesn't work but i don't use that
corner so like i don't care yeah or you have like in the machine learning side you have like
this library depends on some old version of tensorflow but it doesn't you're not using
tensorflow you're using some utility library in it but it also has support for tensorflow but
you're not using it so if you had a different version of tensorflow on it it wouldn't really
affect you because you weren't using that portion of it. Right, but it sounds like Pip will say, no, I can't install these things.
They make statements about two things that they can't coexist.
But you're like, I don't really care that they're working.
You know what I mean?
So I think this is good.
I think it makes things more predictable.
But you're right, Matt.
It's definitely going to cause some challenges.
And maybe it'll get people to update things like the base library statements
that they depend upon more carefully yeah one of the things i'd like to see if we're talking about
pip is that i'd really like to see um python come out with um dot releases that if there's a new
version of pip that all the the latest versions of python Python have the latest version of pip. I'm just
really tired of installing Python places
and immediately having pip out of date.
Yeah, I actually have an alias
that when I create a virtual environment
then it immediately does a pip
dash install dash dash upgrade pip
and set up tools because why doesn't it
just do that for me? Yeah. Anyway.
Can I just update the top level one so that
all my new virtual environments get the newest one? Yeah. Anyway. Can I just update the top level one so that all my new virtual environments get the newest one?
Yeah.
Anyway.
This is coming.
They blogged about it.
I'll link to the blog post from the PSF.
They said there's a couple things you can do to help first and most fundamentally help them understand how you're using pip.
They have some user experience research going on.
There's a link to go do part of that.
You can check right now if this is going to be a problem for you. Go to your
project, your virtual environment, activate it, and type
pip check, and it'll tell you
if you are in this inconsistent state.
I had one website that was,
a couple that weren't. I hacked around
until I fixed them up, then everything was good.
Make sure you test the new version of pip.
It'll probably be out in May. Help spread the word.
All three of us are doing that. Ta-da.
Awesome.
If you develop a tool like Poetry or something that lives on top of this,
make sure that you test integration with the thing coming out in beta in May.
All right.
Really quickly before we move on, let me tell you all about Datadog because this episode is brought to you by them.
So let me ask you a question.
Do you have an app in production that's slower than you'd like?
Is its performance all over the place?
Maybe fast, sometimes slow, others?
Here's the important question. Do you know why
it's slow or inconsistent?
With Datadog, you will.
You can troubleshoot your app's performance with
Datadog's end-to-end tracing. Use the
detailed frame graphs to identify bottlenecks
and latency in that finicky app of yours.
Be the hero that got the app back on track at your company.
Get started with a free trial today at pythonbytes.fm slash datadog.
Use a cool product, help support the show.
Matt, I think this next topic you got here, this pretty much is on everyone's mind right now.
Maybe you're trying to not think about it, but there's some useful stuff going on here.
Yeah, just with the whole coronavirus, COVID teen, I've been thinking, what can I do as an individual
to help?
And I think a lot of people are trying to flatten the curve or limit the growth.
And I think a lot of people, at least in our community, understand the importance of that,
but maybe not the general populace as well. So one of the things
that I thought that I could do is just spread among my local community through my local social
media. What is the growth locally here where I'm based? I'm based out of Salt Lake in Utah.
And so I had a problem actually getting the data. I mean, there aren't any repositories that have local utah data
the local department of health is reporting on it but their data there's not a source of data that
you can cleanly pull so i've i've been pulling making my own data source and then i've been just
posting those on twitter and linkedin just with my local data to sort of track what that growth
looks like and sort of put that in people's minds to sort of track what that growth looks like and sort of put
that in people's minds to sort of, hey, think about what's going on locally and see what changes
you can make. And I did some basic modeling to sort of predict what's going on because I've been
reading other people's models about, you know, this is an exponential growth rate, blah, blah,
blah, what that looks like. And so I did some basic models using machine learning,
but it's also in the Twitter sphere and elsewhere, people are saying all these data scientists are coming
and just throwing machine learning at this,
and that's not the right thing to do.
The right thing to do is read the literature
and see what epidemiologists and others have done.
And so I just want to point to some things that might be interesting. I've got a link to a
Kaggle project that shows making some basic machine learning models, but it also points to
a library that's found in SciPy that probably a lot of people don't know about. I know about it
because I teach about it. And that's in SciPy, there's an O-D-E-I-N-T function, which is a
solver for what's called ordinary differential equations.
And so this is probably a math class that you may have taken in college.
I took one in college and it was purely theoretical.
And I basically forgot everything since then.
But there's what's called an SIR model.
And that stands for you have people who are susceptible to being sick, you have people who
are infected, and you have people who are recovered. And so typically these flatten the
curves are looking at the infected part, the infected growth of that, but there's a relationship
between all these three different groups and there are more complex models. But if you use
ordinary differential equations, that is the tool that epidemiologists
and statisticians use to plot these and determine what's going on here rather than just, you know,
throwing it at linear regression or trying to do a machine learning model that way. So I just want
to point people at this Kaggle project. It's got an example of doing this SIR model. It's also got some basic machine learning models as well.
But be aware that a lot of these things that we learn about,
that in theory you think, oh, this doesn't make sense.
This is actually a case where ordinary differential equations
are the right or one of the right tools to look at this data
and understand what's going on there.
Yeah, that's a cool project.
Yeah, definitely a cool project.
I'm sure there's a ton of data science going on around all of this.
There's a lot of data.
It's coming from different places, like live dashboards and stuff.
And I think this is really cool.
I didn't know about the SIR model.
That's cool.
There are a bunch of other Python libraries as well that epidemiologists have created and whatnot that implement these SIR models. And there's another one, S-I-E-R.
And so check those out if you're interested in sort of digging with the data. But a plea to people
to think about what you can do for your local community. If you've got skills to help out,
what can you do locally to help out and help others. Yeah, absolutely. Also, random side point
here, looking through this code on Kaggle, I never realized that you could
unpack a tuple in a nested way.
Thing, comma, tuple unpacking thing, right? So where
you can layer these in deeper and deeper. That's pretty awesome, actually.
Your data structure is nested, right?
Not necessarily going to make your code easy, but you can have fun there.
It can definitely make it shorter.
All right, cool.
That's a nice one.
Brian, you're getting all philosophical on this with this next one.
What's up?
Okay, so this is totally, we're going from serious to definitely not serious.
So I noticed this also.
So there's a Reddit thread that's now, or I don't know if it was Reddit or Stack Overflow, but it got taken down.
But essentially the question was, why does all return true if the iterable is empty?
So there's an all keyword in Python that I guess actually a lot of people don't know about that takes an iterable and it returns true if all of the elements of the iterable are true? And because, you know, actually the person
asking the question said, shouldn't it be false? Just like, you know,
you can say if list, and if it's an empty list, it's false.
Why would all be true if it's empty? And I enjoyed the
conversation, and somebody wrote an article about this,
why has all returned
true the end lesson is it doesn't matter why because the core team decided it and you just
need to know it and work around it's been busily decreed to be true so therefore it is true yeah
and then one of the things i wanted to point out from this discussion is uh the statement all
unicorns are blue i just love that you can't tell me it it is definitely true because
there are no unicorns so therefore it's true for me to say it's definitely not false blue yeah
and uh so i like that and i guess i'm glad that my daughter doesn't listen to this
to have hear me say that there are no unicorns sorry honey don't break her heart next you're
gonna talk about no santa or what's going here. Like the tooth fairy is not real.
But the person writing this article, Carl Johnson, is actually also a philosopher and a programmer.
So he talks about this 2,500-year-old debate in philosophy about whether or not all unicorns are blue should be true or false.
And also we get talk about predicate logic and Socrates and Aristotle and syllogisms and
things like that. Actually, we'd never at the end. I still don't know why the core team chose
that that is true, but it's a fun thing to look into. That's fun. So looking at it from the
outside, I envision it working like this. The way all works to be efficient is it says for thing in collection,
if not thing, return false,
go all the way and return true.
And it just never goes into that loop,
so return true.
Probably, yeah.
But I probably got to go and open up
the CPython source code to find out.
Matt, what do you think?
I don't know.
I'm looking at the Unicode symbol,
the Unicode emoji in my python repl right now and that's a hex code point 1f984 and it doesn't look blue it looks pink so
we definitely got to put somebody's gonna have to put a comment on that blog post
yeah that's not true all unicorns are pink it's interesting that they did make it true we definitely got to put a, somebody's going to have to put a comment on that blog post.
Yeah.
Yeah. That's not true.
All unicorns are pink.
It's interesting that they did make it true to your point,
like in a Boolean context,
right?
Anything empty in Python is false.
So yeah.
Yeah.
I mean,
another option would have been to raise an exception.
So you can't ask for the truthiness of nothing.
The main reason why I wanted to bring it up.
And the main reason I enjoy reading this article is now I will never forget that all of nothing is true.
I'm also thinking, have I ever used all in an if statement? I don't know that I have used all in an if statement.
Where do you use it?
Yeah, I guess I have. Yeah, I've used it. Usually I'll put some kind of generator expression in there.
Because I don't usually want to test all the things are actually true.
I want to test the dates are greater than today for all of them or something.
So put a little comprehension in there and then ask all of that.
Yeah, I guess it returns a Boolean, so you would put it in an if statement.
I guess so.
I don't use it a ton either, but every now and then I'm happy with it.
If I put it in an if statement, am I going to loop over the contents of all, right?
I don't know that I have it in an if statement.
I loop over.
No, no.
It would be to avoid a loop, right?
It would be like one line of loop, basically.
Cool.
Yeah, I won't forget either now.
I didn't realize it was so philosophical, but apparently here is all right last one this was really quick this is a project
written by jean sebastian duet like that closely right called pi test monitor and the idea of pi
test monitor brian you familiar with this one already i looked it up quickly yeah but i haven't
used it before yeah but okay Basically, you pip install this,
and then anytime you run a PyTest test,
it's going to automatically collect some data for you.
It'll analyze memory consumption, timing, CPU usage,
stuff like that,
and it'll put it into a little local SQLite database file,
and you can look at it over time and whatnot.
So it's pretty cool, right?
If you
want to say, well, how long does this code take to run on the production machine versus on our
laptops, right? You actually get tracking and whatnot from that. So not a huge addition,
but it's kind of cool. It's built on a couple of libraries, PSUtil and Memory Profiler,
which let it basically go and ask all these questions
on a per-test basis.
Which is cool. And then, obviously,
it just runs in PyTest.
I could see where you might want to have
a report where you just want to
run, limit what
that's running on. I don't know that I would want
that necessarily on everything, but
you might have some hotspots or whatever
where you want to monitor that and report on that. Having it on everything but you might have some hot spots or whatever where you want to
monitor that and report on that right having it on everything seems like maybe i don't know what
the performance implication implications are of like all that monitoring yeah yeah i think it'd
be cool to see this is one of the parts where i'd like to actually see the reporting of this project
have some reporting that's nicer around it.
Because that's some really cool information, but it doesn't
I think some reporting would help it.
It's not beautiful, is it?
It is in the SQLite database. You could grab it and do what you
want, but then you've got to write that.
It's like coverage. One of the wonderful things about
coverage is the reporting
part of it. Yeah, absolutely.
Alright, well, if that's something you guys
care about, go install that and check it out. Alright, well, that's it for all of our major items. Yeah, absolutely. Alright, well, if that's something you guys care about, go install that
and check it out. Alright, well, that's it
for all of our major items. Brian,
Matt, you guys got anything you want to throw out there extra
before we get to our joke?
Stay safe. Yeah, absolutely.
I've got nothing extra. How about you, Michael?
Well, I took two of my projects that I've been kind of
fiddling with for either a short time
or a long time, depending on which one,
and put them both up on PyPI
as things you can now pip install.
So that's kind of cool.
The switch laying, my little extension to add switch
to the Python language, you can pip install
that now. I still love that thing. I use it all the time.
And then my markdown
sub-templates. Oh, what's that, Matt?
You use that in production.
Oh, yeah. All the time.
Awesome. Yeah, there's like a couple of places where it
would be like this huge if statement or some other weird look up and it's it does cool stuff to say
like oh you already tested for this case or you're like have the same case in two places you would
miss one the second one because it'd be caught by the first and so on cool yep and then the second
one the markdown sub template thing which we talked about before, but it was not then pip installable.
So now it is. People can check those out.
Do you have tests on these, man?
Of course we've got tests on those.
Okay.
I don't have a PyTest monitor on it, but we've got tests going.
I have tests in there. So they do exist. The code does exist as tests.
It does. Yes, we can speak of it.
Yes.
Are you all ready for a joke?
Yes.
This one is not really that funny.
It's more like.
As opposed to the rest of our jokes.
Dude, I think I've done that.
Well, some of them are like meant to be straight out funny.
This one's like funny, ironic, because yeah, I did that too at one point or something like that.
Right.
So this guy on Twitter sent a message, sarcastic pharmacist, sent it over and said,
I was listening to a discussion on TalkByThon about rebooting a server instead of chasing bugs
and thought you should check out xkcd.com 1495.
And there's just a picture and it has like a trade office.
It's okay.
Why is everything broken in my life?
Here's the deal.
I could spend one to 10 hours
figuring out why my server
keeps running out of swap space and crashing,
or I could spend five minutes
plugging it into a light timer
that reboots it every 24 hours.
That takes five minutes.
Let's do that.
Yeah, so true.
Yeah.
That's actually an interesting thing.
We just ordered a bunch of web programmable power strips.
Yeah, because one of the things you do when working with electronics is sometimes power cycle the things.
Ain't no way to go and do that when I'm working from home.
How interesting.
So you built that into the CI, cd hey with the tests like let's
do that sleep most of the time these aren't problematic but there is the occasional
in development instrument where um or in development operating system portions or
something like that where it gets into flaky situations and rebooting is a good is a good
thing to do from the start because as a software developer i can get things into really wacky states it doesn't happen a lot but um it happens
enough to where it's good to know that yeah that you can buy these webs power switches um we're
getting industrial ones which are kind of expensive because you can stick them in instrument racks
but they're just a normal power strip but you've they've got a web address and a rest or i don't
know rest like api that you can uh put them in strips and if you yeah if you wanted to use them but they're just a normal power strip, but they've got a web address and a REST-like API
that you can put them in strips.
And yeah, if you want to use them in a CICD pipeline,
you can call them that way too if you want.
But normally we just have them as a backup
so that we can log in and reboot them if we need to.
You don't have them connected to Alexa?
Alexa, reboot my computer.
Yeah, my test won't pass. Hell, reboot my computer. Oh, no.
Yeah.
My test won't pass.
Hell, shall I reboot again?
Yes, please.
Awesome.
All right.
Well, Brian, thank you as always.
And Matt, thanks for being here today.
It's fun to chat with you.
Yeah, thank you.
Nice chatting with you.
Thank you for listening to Python Bytes.
Follow the show on Twitter via at Python Bytes.
That's Python Bytes as in B-Y-T-E-S.
And get the full show notes at PythonBytes.fm. If you have a news item you want featured,
just visit PythonBytes.fm and send it our way. We're always on the lookout for sharing something
cool. On behalf of myself and Brian Auchin, this is Michael Kennedy. Thank you for listening and
sharing this podcast with your friends and colleagues.