Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 218, recorded January 27th, 2021. I'm Michael Kennedy.
And I'm Brian Okken.
And Brian, we have a special guest, Jeremy Tanner. Welcome, man.
Thank you. Thank you for having me.
Yeah, it's really great to have you here. You know, we've got to talk a little bit at conferences and stuff.
And now that we just don't seem to have conferences in the world anymore, we're going to have to drag you into our world to actually get to catch up.
It's good. I need a tiny bit of that Portland fix. I love being up there.
But I mean, the entire Pacific Northwest, but Portland in particular.
And so, yeah.
So where are you at?
I am in Austin, Texas.
He's in the Portland of the South.
I thought that was. Oh, yeah.
Nice. All right. Well, maybe real quick.
Tell us about yourself, Jeremy. People who don't know you.
Absolutely. I like motorcycles. I like suede shoes. I like smoked meat like Python.
I'm currently working in developer advocacy at Equinix Metal and living in Austin, Texas, raising two awesome tiny copies of myself and trying to sort of ride it out while the world is melting.
I assume like everyone else is.
Yeah. Yeah. You know, we share a lot of interests like you and I both do motorcycle riding and just a sidebar, like the ability to just jump out on a bike, get away, cruise through the mountains and just pull back into the garage and have, you know, somewhere outside of your four walls, a really cool experience.
Like that's a neat thing to do when you're otherwise just stuck at home.
It's we have there's so many like technology guardrails, right?
Like turning your phone screen to grayscale so it'll be less enticing, turning off your notifications, whatever else.
But the really nice thing about riding a motorcycle is the guardrails aren't there and you absolutely have to be paying full attention.
So it's not all I'm also thinking about something else.
You're like, well, do you not want to die?
Then like watch the watch the road, be aware of everything.
And so it forces everything to the background for however long you can manage it.
Yeah, that's such an interesting idea of like, I'm just going to put the world out because I really have to focus on this situation, on this curvy road or whatever.
Fantastic.
All right. Well, Brian, I believe you have the first item.
Something is this about laundry or what is up here?
Constant folding, of course.
Yeah. Laundry.
Well, I do like the little the little animated sloth holding something.
It's nice.
No, I brought this up because so it's an interesting article about constant folding.
So constant folding is when a language replaces your constant expressions at compile time rather than computing them at runtime.
So say something like, you know, 24 times 60 or whatever.
It'll just replace that.
Wait, wait, wait. Let me, did you just say compiling?
Yeah.
Like when I, when I compile, like, what is that?
GCP, PY, GPY.
Like, how do I know?
I mean, this is a misconception.
I think a lot of people have is like languages like Python don't actually get compiled.
They do.
Well, there's the bytecode compiler, right?
Yeah.
And I, and that happens, I mean, for a lot of, I guess, if you just have a script that's just one file, that'll happen every time you run it.
So that doesn't really, there's not really a pre thing.
But if you've got an installed package or, or lots of stuff that gets run for a long time.
Yeah.
That bytecode will happen once bytecode conversion.
What is that called?
Is that compiling?
I don't know.
Yeah, I think so.
But it just doesn't compile to machine instructions.
It compiles a bytecode like Java or .NET.
But then what happens is it doesn't JIT compile.
It just interprets it from there on.
Right.
So, yeah, I think there's, there's levels, but it's automatic and hidden, which is cool.
Well, CPython at the very least has this notion of constant folding where it just come, you know, comes up with your expressions and does it at, at the compile time instead.
And it's something that I really don't think, like, I don't really think about in Python.
I definitely think, I know what's happening.
In, in C, in C++, we got the precompiler going on.
But the, it does happen and you can see it in action.
And this, this article talks about it.
You can use the disassembler to disassemble a bit of Python code and see what it would look like outside of, you know, after the conversion.
And so something like, you know, if, if you recommend, one of the examples was the days in seconds is 24 times 60 times 60.
And, and then it, the, the, the, the Python will just convert that to, what is it?
86, 400.
Yeah.
Now the, I'm bringing this up.
Like one of the things, this is kind of an interesting article about really how it does it.
And the rest of the article kind of goes into, you know, the, the implementation on CPython of how the folding happens.
And that's interesting.
But mostly the reason why I brought this up is because I want people to remember that this happens.
So if like for this example, it is way better to put in your code days in seconds equals 24 times 60 times 60.
That's really clear.
You don't really have to comment it much because people can just look at it.
But if you were to manually replace that with 86, 400, it's suddenly a magic number then.
And people won't, you know, in the future, you'll be like, where did this number come from?
What happens if I change it?
It's going to muck everything up.
So I think things like this are great.
I use it.
It talks about, it's not just math expressions, things like string expressions too.
So you can, you know, if you're going to do a, you know, 30 different dash marks to print across the screen, you can say like dash, you know, the dash character times 30.
And Python will just convert that for you at bytecode time.
Yeah.
Very cool.
I just checked it for strings and yeah, it definitely says, you know,
the final result of the calculation of a bunch of constants involving strings is the answer.
And you know, the benefit is if it's always going to be the same outcome, why compute it every time you run that function or do an import?
Yeah.
And there's some size optimization that happens that Python realizes that some things are so in the article talks about some of the constraints.
So if you, if you end up with like, you know, a 4,000 character string after doing it, or, you know, I think they found the limit was it'll go up to 4096.
But if you make it 4097, it doesn't do the folding at that point.
I don't think you have to memorize it.
I don't think you have to memorize that.
I just know that Python does has some optimization where it says if the pre-computed value is too big, then don't worry about pre-compute and do it at runtime.
Yeah.
It makes a lot of sense.
Perfect.
I like it.
And you know, it's another cool chance to just play with the disassembler and understand that a little bit better.
Jeremy, you ever play with disassemble things?
No, but was appreciated that the, it was a way to avoid a little of the magic number disaster where Head looked back and reviewed a bunch of, I think it was physics code.
And so often there will be like, oh, if you're a, if you're a domain expert and you're like, and you're familiar with nuclear reactors, then yeah, you'll, you'll know, you'll know why these pieces are here.
I, please name them things.
Yes, exactly.
Here's the, the number of moles of, or whatever in chemistry.
Like it, it doesn't make any sense, right?
So if you kind of do a calculation, but you don't have to pay for the calculation.
That's, that's really nice.
I used to do this all the time with the days and seconds, like the seconds and days, because what I would do is I would go to like a date time.
I would say date time dot total seconds divided by seconds and days.
Well, that's how many days it is until Paul was on talk Python, the guy behind the daytime stuff and says, do you know, you can go to a time Delta and say it has days equal one and then divide the date time.
Another time Delta by days equals one.
And it'll tell you the same answer.
Like, that's just crazy.
I, I didn't know how was I supposed to know I could do that.
So, but yeah, this is definitely a cool one.
And the disassembler is neat to really understand what's happening.
Like these little constants, you know, load const, store name, load const, just get fed straight through this huge C eval.c switch loop.
And that's your program.
All right.
One of the things I want to bring up is that these are fun little tiny examples of using the disassembler, which is a fun thing to do because when you, and if you're trying to do a larger function and disassemble it,
it's going to be more complicated, but it's kind of fun to look at the output of the disassembler.
Yeah.
Definitely.
It gives you that inside view.
All right.
I stole this from you, Brian.
It's a good one.
So this one is called pip review and pip review is really cool.
I learned about this from PI coders, the newsletter and the idea is that updating all of your packages that you've got in a virtual environment is a hassle in various ways.
One way is I could just not set, you know, I could not pin the version numbers and just install the latest.
Right.
But then if I try to reinstall, it just says, you know, those are, those are up to date.
Maybe I see.
Oh, I know that there's an update for HTTP X.
I'll do a pip install dash you pip X, right?
Upgrade and it'll upgrade it, but it won't upgrade the things that pip X installed.
Even if I ask pip X to upgrade itself, you know what I mean?
So there's like this, the dependencies of the dependencies and all that become just a hassle.
So there's this thing called a pip review, which lets you smoothly see all the available updates and then apply those.
This used to be part of tools, but it's now its own standalone thing that just directly uses pip.
So like all good things, you pip install pip review, which is very meta.
And then you have pip review.
And then you can just ask it to do things like just run pip dash review on the, on the command prompt terminal.
And it'll tell you, you've got this version of this library.
There's a new one available.
And that's pretty much equivalent to doing pip list dash outdated.
But then you can also just say, and fix it.
So pip dash review --auto, which will just find all the things out of date and update them,
including the dependency of the dependency of the dependency, which is pretty awesome.
It'll also let you do this in an interactive way.
So you can say --interactive and it'll say, this is out of date.
Do you want to upgrade it?
Yes or no.
NumPy is out of date.
Do you want to update it?
Pandas is out of date.
Do you want to update it?
And so on.
And you can selectively opt into those.
And then you can even come up with a constants file that says, you know, please don't update these automatically.
They're stuck in an old version for whatever reason, into a certain version.
What do you guys think?
I hear NumPy and Pandas and Matplotlib.
And it's all the flashbacks, right?
I think we met in before time when I was an anaconda.
And so, I mean, since this certainly looks interesting and solving problems.
But on my end, still very much, especially for scientific Python bits, a conda loyalist.
Yeah, yeah.
Of course.
Both for package management and for environment management.
Yeah.
That's a whole different side of things.
And, you know, conda definitely managed that quite a bit, right?
Like, it's all about you can open up your navigator and create your environments and interact with those in that way as well.
So, yeah, I think this probably applies more to if you're just doing straight pip or maybe you're thinking, well, pip env or whatever.
The other alternative would be to use something like Dependabot where it finds those changes.
You pin your version.
It says there's now a new version and then it upgrades it.
But that's always going through like some external workflow.
And this is just like, well, I don't want to go through that.
I just want to right now find the new stuff and change it or don't.
Yeah, I tried this out on a project of mine that uses, you know, Flit and the PyProject.tomal to define a couple pinned versions of things.
So I wanted to check to see if they're out of date.
And I tried the pip review auto to just auto update them.
And now that pip has this dependency resolver, it noticed that my project had some pinned and it said there is a new version, but there's a conflict with your project.
So just be aware you need to figure out that conflict on your own.
Oh, interesting.
Okay.
That's nice.
Yeah.
Very nice.
Yeah.
I've recently run into some issues with the resolver and the new.
Yeah.
We've gone over that.
Nice.
All right.
Jeremy, what's your first one?
Keyboards.
My first one is keyboards.
And so I have fallen well down the mechanical keyboard rabbit hole.
You want a loud clackety clackety clack version?
Just like such.
Yes.
So I suppose the Python tie in is, first of all, like, yes, your keyboard is probably the
way that the bulk of the Python gets into your computer.
And so as much as we would like to just plug up Jack straight into the brain and think code,
it doesn't work that way yet.
So it makes sense.
So I've fallen into mechanical keyboards mostly to try and get my wrists to be less hurdy.
I suppose for our viewers who are watching with their ears in the future, the listeners,
if this is on audio, I've just shown you my hands.
I may show you keyboards, but I'll have to remember to describe those.
That's right.
But I have started to really love mechanical keyboards for ergonomic improvements and ability
to sort of restructure the way that they work for my benefit.
Most of the keyboards that you'll see connected to computers are using that are like a flat bar
shape.
Use QWERTY, which actually dates back to...
Everything wrong.
Everything wrong that you could do, right?
Are you...
Do you know when QWERTY came into usage?
Yeah.
I mean, very clackety, right?
For the...
To slow down the typewriter.
Yeah.
But in...
It was in 1873.
And so like Civil War era.
Like back in a...
Back in...
I mean, within 10 years of the first American Civil War.
So when we were still like settling our disputes with like swords on horses and so on.
And just like there's always a...
Continues to be a better way of doing things.
And we keep on working towards the better way.
Like the layout of keyboards is sort of a vestige of a pastime with different requirements.
Kind of like wearing pants now, right?
Like you used to be going out and seeing people now.
Shorts.
Yeah.
Let the shins breathe.
Exactly.
So anyway, like with the...
What's useful on the keyboards is in addition to getting ergonomic benefits, you can change
up your key map.
Normal keyboards have maybe 100 keys on them or so, but they really have 200, maybe 300 keys.
You have modifier keys.
You push shift and you're like, okay, now all those keys are now...
All the letter keys are now capitals.
The one is an exclamation point and so on.
And taking key maps are the ways that you can take and change those keys to whatever...
Right.
For example, if you wanted to do...
Yeah.
If you want to say switch to Dvorak or something along those lines, right?
I had a friend who taught himself Dvorak, but seeing the Cordy keys was so impossible for
him.
He shaved all of the letters off of his keyboard because it was either easier to have nothing
rather than have the wrong thing there.
That's sort of what's going on over here.
This is a...
Oh, look at that.
A TRIUS.
A 44 key split.
Okay.
You got to describe that to people.
First of all, what is that?
So a company, Keyboardio, just keyboard.io, has made a...
I think a gentleman in the...
Yes.
Pacific Northwest also made a hand-wired version of this.
Jesse and Kaya at Keyboardio made a mass market version that's manufactured that instead
of soldering everything together and ordering the pieces, you can just get a completed keyboard,
which is very nice.
Yeah.
And so for this keyboard, you're going to operate largely with layers.
And so you don't see as many symbols or numbers here.
And so when you hold down maybe super or function, it's going to change one of the sides to arrows,
change one of the sides to a number pad, change one of the other sides to the symbols,
exclamation point, at symbol, asterisk.
And instead of reaching and twisting like you might on a normal keyboard, where every
time we thought of a new thing, you're like, oh, the hash symbol, that's going to need to
go somewhere.
All the other stuff.
Yeah.
Well, you need to add it on and the keyboard keeps growing.
Here, your hands stay in about the same position.
But when you put your ring finger down on the home row, of your left hand, the entire right
side changes to different keys.
And so the way that I suppose the Python tie in there is that most of these keyboard firmwares
are written in C because you have the little microcontrollers under that's telling what keys
what to be.
But there are Python portions.
And so the command line interface that QMK, this project on GitHub, quantum mechanical
keyboard uses, is written in Python.
Some of the tools that your key maps are sort of always in flux.
And so you can evaluate the ways that you're using your keyboard.
So Python can help out there to help you make a heat map of, OK, which keys am I pressing
most frequently?
Let me move those to a stronger finger.
And again, because we're sort of home in quarantine, pandemic time, it's fun to have this sort of
escape room to get yourself out of.
And there's a little bit of a challenge to remember where that new key is.
Or even assembling.
You've got key caps coming from one place and trying to find out what new features you might
be able to pull down in the firmware from GitHub on another.
And folks are making different designs.
You can go with split hand boards.
There we can center that up into the interview.
This is, for those who are listening, RGB, KB, Sol, the sun.
You basically have two separate pieces.
Oh, and it has LEDs.
Beautiful.
So you have two chunks, one for each hand, and you can position them however it fits for
you, OK?
Yeah.
And so it can open up your shoulders, open up your upper body a little bit.
Hopefully make your wrists less hurdy.
Was the...
Yeah.
Well, I used to...
I've struggled for...
Man, I got to do math for 20 years, maybe.
15 years with RSI issues.
And it's...
I mean, it was to the point where I had surgery on my right hand for carpal tunnel stuff.
And I thought, man, what am I going to do?
I did physical therapy.
It was really quite scary, actually.
And I just...
What I did, two things.
I got a much, much better, more ergonomical keyboard and only use that.
Like, I never type on my laptop because that thing is a kiss of death for my hands.
And the other one is I force my...
I'm right-handed.
I force myself to become left-handed for mousing.
Because I use my right hand for the arrows and page down and insert and all that.
And I figure it's already doing all that stuff.
Might as well.
Do you use one of the sideways?
I cannot find a good sideways left-handed one.
Oh, that's...
It's so super hard.
That's going to be tricky.
Yes.
I could either go vertical or I could go left-handed.
And left-handed is working super well for me.
But I'm using the little Microsoft ergonomic travel.
And I love that.
This thing goes with me everywhere.
I don't go anywhere without it.
So, yeah.
The best way to fix it...
That's an important thing.
You're good.
The best way to fix it is to touch your computer less.
But if that's not an option.
So, I mean, the other things that have beat my hands up and I'm trying to be better about
are if you hold your phone and you just scroll and you scroll some more and you scroll
some more.
You can do it with your left hand instead.
Or you can try and not look into the abyss so often.
Yeah.
I've used voice typing.
Go ahead, Brian.
Doing a lot of less doom scrolling now than I used to.
So, things are less crazy.
Brian, what have you got for your setup?
Do you just type on your MacBook or you got something better?
Me?
Yeah.
Oh, Kinesis.
Oh, my gosh.
You are full on over there, dude.
A Kinesis one.
Dishes.
Yeah.
So, I've been using Kinesis for like 30 years.
25 years.
Wow.
And similar.
I had problems with my arms and I was just like a couple of years into my career and I'm
like, oh, my God.
I finally get a programming job and I can't do it anymore.
So, but I switched to the left-handed mouse and now I don't even think about it.
Some people say like, I don't like switch the mappings.
I don't switch the left to right.
I just move the mouse over and use it with my left hand.
And then also the Kinesis.
And then when the whole like mechanical keyboard thing started, people were talking about that.
Like, what's all this about?
And then I found out that the Kinesis has been mechanical for since it started.
Yeah.
Kinesis is definitely, definitely an interesting one.
Although I think I want to get a new one because the key, whatever the mechanics and behind it are the wrong color or something.
I want to get ones that I have to push down a little harder because I find that I rest my hands on my keyboard and it'll start typing stuff.
So, I'd like to have it be more hard to push down.
I think there's probably three things that you can do.
You can either crack your switches open and put in heavier springs.
You can go with a, you can get a key switch puller and pull out the switches and plug in.
Depends if they're hot swappable or if they're soldered down into the board.
And so, I'm not certain how that one's constructed.
But oftentimes when there's a, if there's a greater investment in getting the board in the first place, like the ErgoDox ones are hot swappable.
So, you can take a puller and I have, not in front of me, but over and over in a bin, different key switches that I've tried.
Some that are quieter, some that are louder, some that are heavier, some that are really light.
Yeah, eventually you figure out sort of the Goldilocks situation.
And instead of a keyboard that's made for, to sell millions and millions of units, you've got one that maybe are out of billions of people.
There's maybe three like it that are just like yours.
Fantastic.
Yeah.
Magnus Carlson, Magnus Carlson says, he has an old ErgoDox over in the corner.
Right on, right on.
Why is it in the corner?
Don't put baby in the corner.
Desk, get those, love those wrists.
Yeah, yeah.
The one that I love, the thing I love about this one is it has such short keystrokes.
Like you barely have to move your fingers, which to me, a lot of these really nice ergonomic ones, I feel like you've got to move them a lot, which I don't know.
It's always a balance.
This one works well for me, but all of these things are super fascinating.
Yeah.
There's switches with adjustable travel.
And so, you can cut probably more than a millimeter out of it going from two down to either one or maybe even 0.8.
Oh, wow.
So, you can tune it exactly to what you're after.
I tried yours, Michael.
I have one of those, whatever that you've got.
Yeah.
Sculpt ergonomic or whatever it's called.
But it's a Bluetooth one and I can't do Bluetooth keyboards.
The Bluetooth delay gets me.
You'd think that I wouldn't be able to notice, but I notice and I don't like it.
Yeah.
Wouldn't it be nice if you could buy keyboards, wires?
And then I suppose we didn't talk about mousing either.
We talked about like the actual device.
But in QMK, that firmware and other keyboard firmwares, if you hold down a button, the other side of your keyboard can become a mouse.
And so, both any of your keyboard keys can make it travel diagonally or up and down or can be used as click.
And so, you can replace your, especially for traveling, you can replace your mouse with being able to navigate, move the mouse around with the keyboard.
Sounds awesome.
If you could ever fly again, I could see setting a little laptop on like the little fold down tray.
Put that keyboard on top and you're good to actually get some stuff done.
All right.
Now, before we get on to the next item, let me tell you all about our sponsor for this week, Datadog.
Thank you, Datadog, for sponsoring the show.
If you're having trouble visualizing latency or CPU or memory bottlenecks in your apps and you're not sure where it's coming from or how to solve it, check out Datadog.
They seamlessly correlate logs and traces across individual requests and you can quickly troubleshoot your Python app.
Plus, their continuous profiler allows you to find the most memory and CPU consuming parts of your production code continuously.
Just run it all the time.
Minimum overhead.
Pretty awesome.
You'll be the hero that got that app back on track at your company.
Get started today with a free trial at pythonbytes.fm/Datadog or just click the link in your podcast player show notes.
Brian, let's talk about logos.
Sure.
I tried to pull this up, but we're suffering some downtime.
There we go.
So there's an article called Reinventing the Python Logo.
And I thought it was interesting mostly about the history.
I guess I hadn't thought about it too much.
So the history really is there have been only two Python logos.
The original one, which I'm not sure when that came into existence, but it's just sort of some, it looks like a bunch of marshmallows stuck together or something.
It's not terrible.
It doesn't look like marshmallows.
I get light bright vibes.
Light bright.
Oh, yeah, yeah, yeah.
You're right.
Yeah.
So it's like white dots and with like black dots around the outside making the Python word.
And they're like, that's it.
And apparently that passed for a while.
And then the current logo came into play in 2006 by and it was designed by Tim Parkland.
And it's the logo that we have right now.
And I was, you know, I kind of got the Mayan vibe from the Python icon also or the two Pythons.
But there's a quote from Tim said, the logo is actually based on a Mayan representation of snakes, which is very often represented only represent only the head and perhaps a short length of tail.
The structure of the snake represents the natural coiling nesting of snake of a snake as seen on the side.
I don't know.
But having having the symmetry also kind of reminds me of a yin yang symbol or something.
Anyway, I like it.
It's good.
But the article then goes on to talk to a talk to a designer who came up with a possible change and proposed a change in 2020, Jessica Williamson.
And it's pretty.
But, you know, I didn't really read the rest.
I just thought it was curious to think about, should we change it?
And I guess I'm on the side of kind of like the way it is.
But I'm just curious what you guys thought.
Jeremy, go ahead.
I mean, I've grown so used to the other one, but I try not to be a curmudgeon and like new things.
I know Burger King just did their rebrand.
And even though I'm not on the Whopper train, I'm like, yeah, you get something fresh.
I suppose Python even.
There's going to be more people using it in the future than I've ever used it up to this point.
And so, you know, what the what the existing folks think is less of a concern if it if it feels newer or more welcoming.
Yeah.
If it pulls people in and it makes them feel like, oh, this is a fresh language.
Right.
This is like one of the most popular, fastest growing languages in the world.
Of course, it has this logo.
I don't dislike it.
I think it's pretty nice.
I like the colors.
I like the flair.
But I feel like those gradients, those gradients are hard to combine, whereas like this sort of flat color, you can put it in with other things.
But like imagine like the thing you're trying to put the logo on also as a gradient.
Then you got gradients on gradients.
I don't know.
It just it seems a little slightly less versatile.
I like that.
So what I would just like to point out, though, is there are like rules and laws about this logo in ways that are way beyond what the normal person would think.
For example, I used to have a logo that looked like the main Python logo, but it had earbuds on.
However, it didn't have those little holes.
Right.
You see the little holes.
There's the eyes.
It didn't happen to have those.
Well, I happened to be on vacation at a beach with my family and got a cease and desist letter from the PSF because I was violating their trademark because I used a logo that wasn't an exact.
It was an alteration of the Python logo, not the exact one.
Fair.
I kind of felt like, you know, it could have been a little nicer rather than a, you know, full on legal.
Like you must stop this now or else we just have a conversation instead of start it that way.
Well, those are one of those things where if you don't if you don't defend it, then they have you have a case that you can you can start to lose it as to where you're like, well, you never you never made a case of it before.
And so you had you kind of have to.
Yeah, exactly.
Don't separate the snakes.
Don't make one snake bigger.
You can't.
Right.
When I put my app in the app store for the training courses, I had to go back and forth and prove that my my new logo, which is approved by the PSF.
I actually had permission to do that.
And yet have you all looked at what is in the app stores?
They are.
They are change of colors.
They are, you know, funky redesigns.
They're like these weird things are slightly different shape like this one.
Oh, not OK.
There's just a couple of pages.
There's like 15 companies violating the trademark.
And yet with these all presently here, I still had to fight for a week with the app store people to allow my approved one in there.
Anyway, the exercises one is not is not OK.
The one the one with the barbell.
Yeah.
The barbell one is totally not good.
They're all not good.
I'll put the link in the show notes for those of you guys who can't see it.
But boy, it's long story short, there's a lot around this logo stuff that is just oh, that's cute.
Right.
It's quite a bit of stuff around it.
Legally speaking.
Yeah.
Well, you know, the rules aren't really that complicated, though.
They're mostly no.
The logo has to appear in the same colors and it has to has to be visible and in its hole without something in front of it.
Yeah.
And you can't shift.
It can't be squished.
Like mine, the perspective was slightly off for some reason.
And that was also part of the.
And they're also fairly good about like you can send stuff to them ahead of time and say, this is what I'm thinking about doing.
Is this OK?
And you can get preapproval for stuff.
But yeah.
And so now mine is approved and I feel much better about it.
But I had no idea.
I just came out of the blue.
So there it is.
But if anyone wants to start forcing those, they should go have a look at the app stores.
They're out of control.
All right.
What's not out of control is somewhat related is pypi.org is pretty awesome.
Right.
So we go to PyPI and use pip.
Indirectly behind the scenes goes to PyPI and does all of its magic.
You pip install this and install that.
And it would be great if we could put.
Use that as a mechanism to communicate across teams or companies.
Right.
One team built some sort of API interface layer and some other part wants to consume it at your company.
But you probably don't want to put that in the public repository.
It might have secrets.
It might just be inappropriate.
All those kinds of things.
So it would be nice to have your very own.
Right.
Yeah.
Absolutely.
Yeah.
So introducing AWS Lambda PyPI.
So it takes PyPI cloud, which is a way to do self-hosting PyPI, basically a private repository, but then lets you run that over AWS Lambda in a serverless way.
So it's basically free unless it's being used and there's a ton of free requests you get at AWS Lambda before you get charged.
And you don't have to have servers to maintain.
So you can basically set up PyPI cloud to run automatically as an AWS Lambda, which then you can lock down.
That's pretty awesome, right?
Yeah.
So there's not a whole lot to talk about it.
You know, if it acts like a caching server as well.
So can you get.
You probably could.
You probably could do that with PyPI cloud.
Okay.
It's just rehosting PyPI cloud, which I'm guessing it can.
I don't know for certain.
But so you're saying like you'd like to just set that as the global destination.
Well, right.
I wanted to store my private stuff.
Yeah.
You want to pull the public stuff in plus like sort of merge your private stuff with it.
Right.
Yeah.
I haven't tried that, but I suspect PyPI cloud does allow that.
So the security wise, security wise, it says the session keys are auto generated and stored in a secret.
The server configuration contains those generated on the fly.
The Lambda functions can be limited to accessing only what it needs.
And then, of course, you can configure PyPI cloud to display nothing to non authenticated users.
So you basically have to log into it and then you're good to go.
So I think this is a pretty neat solution.
I mean, you've been able to do stuff with PyPI cloud already.
But being able to put it in a cloud for free at scale is pretty neat.
Yeah.
All right.
Next up, we have not just the basics, but beyond.
Yeah.
So if you've read some of L.
Swigert's other Python books, there's a new one, I believe, dropped January.
That's the month that we're in.
Can grab from No Starch Press or can give a look over at the URL above.
And so many other books and references are like, here's how to do the thing.
Go on.
Here's how to do the thing.
Go on.
And when looking through beyond the basic stuff, a lot of it is a look through the Python lens, but at being a better developer and being.
I don't think he said, but for myself, definitely like a less feral developer.
And so, so, so often it's easy to get into that.
Give us your interpretation of that.
That's like, you've just been out on your own.
You figure out how to make it work, but you don't necessarily follow the community.
Raised by.
Agree.
Raised by technical wolves.
So, so often when you.
Love that way of thinking.
That's awesome.
When you, when you join, when you join a team that's been either working together already or has been in industry for a while, there's those things that you don't know that you're doing.
That sort of make, that make you look less polished, whether that's in a, in a code interview.
And so when like Al goes over, what's, what are, what are reasonable variable names?
What are code smells?
Talking about like the duplicating code or what are, so you can write something that works very easily, but here are things that it's so much, it's going to be so much nicer to hear from Al.
Like, Hey, you probably don't want to do this as opposed to hearing from a teammate and a code review.
Like what is 86,000?
You're like, Oh, that's the number of seconds when you multiply by 60 and you do the, yeah, I guess back to the, back to the magic number earlier.
You're like, well, why is, well, why is that bad?
I, I did the math already.
It doesn't make sense to do the math the extra times, but you're like, well, someone's going to have to come behind you and read that later.
And no one hates you as much as future you hates you because it's probably going to be you who comes behind you and reads that later and doesn't remember.
And so, yeah, chapter after chapter, it's just so many things that are like, Oh, again, like code formatting.
Like if you, if you haven't been using formatting and linting, prior and, makes it so much easier to, interact with other folks and sorts of sort of helps you knock those rough edges off.
That aren't necessarily like, this is how you Python, but this is how you become a good, open source contributor citizen.
Or these are the things that you need to know to work, but you really didn't, but you didn't know you needed to know.
Right.
Even probably things like continuous integration and stuff.
You should probably know or get or, or PRs or all those.
Like if you've kind of been doing it on your own, like you can, and some organizations do, but many people don't create PRs for themselves.
They just check in and carry on.
Right.
Uh, so, so those kinds of things.
Yeah, this is great.
And you can read it online or, with the link in the show notes, or you can go buy it.
Yeah.
It's on no starch.
Uh, you can either get like the ebook, you can get printed copy.
Whatever you're, whatever you're into.
Yeah.
And I, I think that I was just looking through the code smells one.
Even people just, just review that anything else.
This is some pretty good stuff.
Yeah.
I love the idea of code smells so much because it's not wrong.
Just kind of turns your nose.
Like, you, this isn't, this isn't so good, but it does work.
Yeah.
One of the big ones that I run into at work even is a lot is a commented out code.
Um, people comment something out and then check it in.
And if it's, if it's dead, delete it.
Oh, we might need it later.
That's what version controls for.
We can go back and get it later.
If you really, really, really don't lose it, tag it or something, or maybe create a branch
with a name, but just don't leave it in there.
Come on.
Yeah.
Or worse.
Don't comment it out.
Just stop using it, but don't delete it either.
Or dead functions.
Yeah.
A dead function or dead class.
Oh my goodness.
Oh yeah.
I'll see that occasionally.
Somebody will rename a function like a function foo old.
Um, why did you do that?
Well, we're not using it right now.
There's better ways to remove that hoarder type code base.
Exactly.
I don't have a problem.
I just have 23 cats.
It's going to be all good.
Uh, all right.
Oh, awesome.
Well, so, let's talk about just a few extra things that you want us to throw out there.
Brian, anything else?
Um, we got a, feedback.
I'm sorry.
I can't remember the guy's name, but in episode 208, we covered pip chill, which is a way to
list out your dependencies, but only the top level ones.
And, and I made a comment that be cool to have this, but not have it list pip chill.
Cause I only installed it for this.
And so, yeah, he added a no chill option.
So that's nice.
And, self-aware pip chill.
And then just before this, I was on these Microsoft developer Twitch channel.
Um, so that's a, that's a fun thing.
The Microsoft developer Twitch TV, they do it weekly.
Um, but don't watch them because you'll collide with watching us.
So, you know.
Oh yeah.
Well, they need to move their time or something.
It's both recorded.
It's all good.
Oh, and, yeah.
Piling says he's been using, pip chill.
So cool.
Cool.
Yeah.
I love the idea of it, but I haven't yet made it into my workflow.
Jeremy, you got any quick extras you want to throw out there?
You cover it all.
I think the, I think the other thing was, Brian's Twitter.
I looked at and it was either today or yesterday that there was the joke about the machine, the
machine learning Twitter bots.
And, and yeah, if like any of those that can be cooked up, always a good time.
It made me, think of, one of the previous times I was in Portland at one of the
conferences, there was both, there was talks on, Nate Smith had made prosaic,
uh, which is a Python, Python for doing a cut and paste poetry.
And so you have any corpus of information you can take and chunk it down.
And, that's paired with a Twitter bot.
And so I went to look back because it's been a while.
I have a Twitter bot that's still running, just called hitch underscore haiku on Twitter.
So every hour on the 42nd minute, it takes all the, all five books from the trilogy and
pulls, a five syllables, seven syllables, five syllables out, combines them all together
and, and puts that into the world.
I think about 25, 24, 25,000 times at this point.
And the machine learning is more wisdom of crowds.
Like I'll get notifications like, Oh, someone to put favorites on them.
Maybe, maybe it happened upon a good one in the, in the large pile of terrible ones.
Fantastic.
You have to put that in the show notes.
The machine learning was funny.
I just found out that like, there's a bot that if you say machine learning, it'll retweet
you.
So I tried to install machine, machine learning as much as I could and have it retweet, you
know, the insights.
So it's like, you're, you're, you're going to Beatles use the bot.
Uh, and then I suppose also on, on the Twitter front.
Yeah.
We just told you not to, not to scroll forever, but my, my favorite client just got a
refresh.
Uh, if you use iOS devices, the tap bots, folks have put out a tweet bot number
six yesterday.
Ooh, nice.
Yeah.
That's cool.
Yeah.
I got to explore more, Twitter clients.
I'm still just a web browser kind of guy, but it works for me.
It works for me.
All right.
I got a quick couple of releases for everyone.
Django 3.2 alpha.
One was just released.
So that's pretty awesome.
Uh, a bunch of cool new features coming in Django.
You can check those out.
My PI 0.8, has just come out and that has Python three, nine support.
PIP 21 is out and that drops Python two support.
So that's also a good one more, step away from legacy Python.
And then real quickly, there's elastic, elastic search.
They changed their open source model, which is a very, I'm not going to say is bad.
I, I kind of support them in this path, I think, but it's a very big deal.
You know, AWS and some of the other, cloud vendors are like basically selling elastic
as a service, elastic search as a service.
And they're like, wait, you just took our stuff and are selling it to other people.
Whereas we have a corporate sort of thing, but we have no relationship with these people.
And that doesn't seem real fair.
MongoDB had exactly the same problem.
And so they adopted the same license, the SSDL or something like this.
Um, basically it's still open source unless you want to resell it as a cloud vendor, then
it's not.
Um, I don't know.
How do you guys feel about this?
Open source business models are hard.
Yeah.
And it's really hard to put the, to attempt to put the genie back into the bottle after.
And so I think the, the, the part of that was unsaid was that Amazon said, fine, take
your toys and do and sell your, and sell your service, but we'll just fork it and continue
to do the thing that we forked it with the old model before it, you know, before it's
changed, it got in there.
And that was that right.
And that was similar to what they did with Mongo.
I think they basically said, we have a thing that is API compatible at, you know, three,
six or whatever level it froze at.
Right.
And then they went on from there.
Yeah.
It's tricky.
I think for some reason, Elastic has a relationship with Google cloud and Azure.
And so they don't have that challenge with Azure, but they have no relationship with AWS.
So here it is.
Anyway, it's don't want to go that long onto it.
I just wanted to throw that out there as something people would be paying attention.
But people that use it internally or on their own servers, there's no problem with that,
right?
Yeah.
That's my understanding.
You guys ready for a joke?
Yes.
Always.
All right.
Brian, I feel like being a manager today.
Can you be the developer?
This comes to us from Kate Maddox.
Well, it comes to us via a guy named Wolf.
Send it over.
Thank you for that.
And it's written by Kate Maddox.
So, all right.
You be the developer.
I'll be the manager.
So I have good news and bad news.
Oh, what's the good news?
I've discovered that the five second rule only applies to food.
Fantastic.
But what's the bad news?
I dropped our tables.
Whoops.
I hope you all had backups.
Oh, boy.
Well.
Did you hear that?
Like, I mean, I probably have this wrong, but I think that the five second rule, I thought
it was 10 second rule.
Anyway.
It depends.
It varies by age.
You know, if you're a little kid and it's candy, it's probably a good 30 second rule.
But I think it used to be a lot longer.
And I think that it came, stemmed from Genghis Khan, or at least I heard this story that Genghis
Khan had a rule about how long he would eat, how long after, how many numbers of days he
would eat meat that had been left on the floor or left on the ground or something like
that.
So, you know, probably not good to eat meat.
It's been laying around for a few days.
That's the three day rule.
Yeah.
You want to keep that pretty short.
Is it warm?
Get the magic number for number of seconds by number of days by cleanliness of floor.
That's right.
It's only 150,000 seconds.
No more than that.
Come on.
Oh, boy.
All right.
Maybe somebody can correct me with the real story.
Yeah.
That's what happens on the show.
We threw out bits of information and our listeners back us up.
Yeah.
All right, Brian.
Thanks as always.
Jeremy, it's great to catch up with you.
Thanks for being here.
Absolutely.
Thanks for having me.
You bet.
Bye.
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 Okken, this is Michael Kennedy.
Thank you for listening and sharing this podcast with your friends and colleagues.