Python Bytes - #218 Keyboards for developers, Python, and some history

Episode Date: January 27, 2021

Topics covered in this episode: Constant Folding in Python Update All Packages With pip-review Quantum Mechanical Keyboard Firmware Reinventing the Python Logo Private PyPI with Serverless Computin...g Beyond the Basic Stuff w/Python Extras Joke See the full show notes for this episode on the website at pythonbytes.fm/218

Transcript
Discussion (0)
Starting point is 00:00:00 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 Harkin. 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 like drag you into our world to actually get to catch up.
Starting point is 00:00:28 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 uh tell us about about yourself jeremy people who don't know you absolutely uh i like motorcycles i like suede
Starting point is 00:00:52 shoes i like smoked meat um like python um currently working in developer advocacy at equinix metal and um living in austin texas uh, 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. And, 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 really neat, a neat thing to do when you're otherwise just stuck at home. It's a, we have, there's so many like technology guardrails, right? Like, you know, turning your
Starting point is 00:01:35 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 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.
Starting point is 00:02:09 All right. Well, Brian, I believe you have the first item. Something, is this about laundry? What is up here? Constant folding, of course. Yeah, laundry. Well, I do like the little animated sloth folding something.
Starting point is 00:02:22 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 if I say something like, you know, 24 times 60 or whatever, it'll just replace that.
Starting point is 00:02:43 Wait, wait, wait. Let me, did you just say compiling yeah so like when i when i compile like what is that gcpy gpy like how do i no 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 so um 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 um if you've got uh an installed package or or lots of stuff that gets run for a
Starting point is 00:03:17 long time yeah that bytecode will happen once bytecode conversion what is that called is that compiling yeah i think so um but it just doesn't compile to machine instructions. It compiles to bytecode like java.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 levels, but it's automatic and hidden, which is cool. Well, CPython at the very least
Starting point is 00:03:38 has this notion of constant folding where it just comes up with your expressions and does it at the compile time instead. And it's something that I really don't think about in Python. I definitely think, I know it's happening in C, in C++. We've got the pre-compiler going on. But it does happen, and you can see it in action, and this uh article talks about it you can use the disassembler to um disassemble a a bit of python code and see what it would look like um outside of you know after the conversion uh and so something like you know if if you recommend one of the examples was um the days uh in seconds is 24 times 60 times 60.
Starting point is 00:04:25 And then the Python will just convert that to, what is it, 86, 400. Now, I'm bringing this up. 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 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 uh if like for this example it is way better to put in your code uh days in seconds equals 24 times 60 times 60 that's really clear you don't really have to comment it much because
Starting point is 00:05:03 people can just look at it but if you were to manually replace that with 86400, 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,
Starting point is 00:05:31 you can say like dash, you know, the dash character times 30, and Python will just convert that for you at bytecode time. Yeah. 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. 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 is 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 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.
Starting point is 00:06:17 But if you make it 4097, it doesn't do the folding at that point. I don't think you have to memorize that. 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-computing and do it at runtime. Yeah. 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 um a little of the magic number disaster where um had uh looked back and reviewed a bunch of i think it was physics code and so often there will be like oh if you're if you're a domain expert and you're like and you're familiar
Starting point is 00:06:56 with uh um nuclear reactors then yeah you'll you'll know you'll know why these pieces are here i please please name them things yes exactly here the, the number of moles of, or whatever in chemistry, like 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, 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
Starting point is 00:07:41 days equals one. And it'll tell you the same answer like that's just crazy i i 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 of l dot c switch loop and that's your program all right one of the things i want to bring up is 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 uh kind of fun to look at the output of the disassembler yeah yeah definitely it gives you that inside view all right i stole this from you b this from you, Brian. It's a good one.
Starting point is 00:08:25 It's a good one. So this one is called Pip Review. And Pip Review is really cool. I learned about this from PyCoders, 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 HTTPX. So I'll do a pip install dash U pip X, right? Upgrade. And it'll upgrade it, but it won't upgrade the things that pip X installed. Even if I ask pipx to upgrade itself. You know what I mean?
Starting point is 00:09:07 So there's like this, the dependencies of the dependencies and all that become just a hassle. So there's this thing called 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
Starting point is 00:09:23 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 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 dash dash 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 dash dash interactive, and it'll say this is out of date, you want to upgrade it? Yes or no
Starting point is 00:10:03 numpy is out of date, you want to update it? Pandas 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.
Starting point is 00:10:15 They're stuck in an old version for whatever reason, pinned to 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 at 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, conda loyalists. Yeah, yeah. much, especially for scientific Python bits, Conda loyalists, both for package management
Starting point is 00:10:47 and for environment management. Yeah, that's a whole different side of things. And 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, pipenv 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
Starting point is 00:11:16 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.toml to define the 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 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
Starting point is 00:11:55 that conflict on your own. So interesting. Okay, yeah, 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. recently run into some issues with the resolver and the new yeah we've gone over that nice all
Starting point is 00:12:05 right uh jeremy what's your first one keyboards my first one is keyboards and so um i have fallen well down the mechanical keyboard rabbit hole um you want a loud clackety clackety clack version just just like such yes um 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.
Starting point is 00:12:38 So I've fallen to 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 for my benefit most of the keyboards that you'll see connected to computers are using that
Starting point is 00:13:11 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 came into usage yeah I mean very clackety, right? To slow down the typewriter. Yeah, but it was in 1873, and so like Civil War era. Oh my goodness. Like 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 and so on and uh just like there's
Starting point is 00:13:47 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 we used to be going out and seeing people now uh shorts yeah let the shins breathe exactly exactly uh exactly. So anyway, 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 the letter keys are now capitals. The one is an exclamation point and so on uh and uh taking key maps are the ways that you can
Starting point is 00:14:29 take and change the those keys to what right put them under whatever you wanted to do like 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 the letters off of his keyboard because it was either easier to have nothing rather than have the wrong thing there that's uh that's sort of what's going on over here this is uh oh look at that a uh 44 44 key split and okay you got to describe that to people first of all what is that uh so a company uh keyboardio uh just keyboard.io has a um made a, I think a gentleman in the, yes, Pacific Northwest also made a handwired 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.
Starting point is 00:15:24 Yeah. and ordering the pieces, you can just get a completed keyboard, which is very nice. 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.
Starting point is 00:16:00 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 I suppose the Python tie in there is that most of these keyboard firmwares are written in C because you have the little microcontrollers 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,
Starting point is 00:16:36 quantum mechanical keyboard uses is written in Python. Some of the tools that your key maps are, is written in Python. Um, some of the tools that, uh, your key maps are sort of always in flux. And so you can evaluate the ways that you're, um, using your keyboard. So, uh, Python can help out there to help you make a heat map of, okay, which, which keys am I pressing most frequently? Let me move those to a, 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's what new features you might be able to pull down in the firmware from GitHub on another.
Starting point is 00:17:22 And folks are making different designs you can go with split hand boards there we can center that up into the interview this is uh for those who are listening uh rgb kb um sol the uh like the sun you basically have two separate pieces oh and it has leds beautiful and so you have two chunks one for each hand you can position them however fits for you. Okay. Yeah. And so it can open up your shoulders, open up your upper body a little bit, and hopefully make your wrists less hurdy was the... Yeah. Well, I've struggled for, man, I got to do math, for 20 years, maybe 15 years with RSI issues.
Starting point is 00:18:02 And it was to the point where I had surgery on my right hand for carpal tunnel stuff and 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 forced my I'm right-handed. I forced 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 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 it.
Starting point is 00:18:52 This thing goes with me everywhere. I don't go anywhere without it. So yeah, I think 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 i mean the other things that are have beat my hands up and i'm trying to be better about are um 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 uh look into the abyss so often yeah yeah i've used voice typing go brian doing a lot of less doom scrolling now than i used to so yeah things are less crazy yeah
Starting point is 00:19:25 brian what you got for your setup you top just type on your macbook or you got something uh better me yeah oh mrs oh my gosh you are full on over there dude okay dishes yeah so those are like the hollowed out like typing in a crater yeah so i've been using kinesis for like 30 years 25 years wow um and uh similar i had problems with uh with my arms and i was just like a couple 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 um but i switched to the left-handed mouse and uh 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 the when the whole like uh mechanical
Starting point is 00:20:16 keyboard thing started people were talking about that like what what's all this about and then i found out that the kinesis has been mechanical for oh since it started so yeah yeah kinesis is definitely definitely interesting one although i think i want to get a new one because the the uh the key whatever the whatever the mechanics and behind it are um uh 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 man 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
Starting point is 00:20:56 you can get a key switch puller and pull out the switches and plug in um it 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 in. I have not in front of me, but over and over in a bin, different key switches that I've tried, that are quieter some that are louder some that are heavier some uh some that are uh really light and yeah eventually you figure out you're the 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,
Starting point is 00:21:46 Magnus Carlson says he has a old ergo docs over in the corner, right on. Why is it in the corner? Don't put baby in the corner. Love those wrists. Yeah. The one that I love, the thing I love about this one is it has such short keystrokes.
Starting point is 00:22:01 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.
Starting point is 00:22:32 Yeah, the 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. Yeah. Wouldn't it be nice if you could buy keyboards, wires? And then I suppose we didn't 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
Starting point is 00:23:05 keys can make it travel diagonally or up and down, or it 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 a keyboard. Sounds awesome. If you could ever fly again, I can 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 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 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,
Starting point is 00:23:38 and you're not sure where it's coming from, 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
Starting point is 00:24:01 at your company. Get started today with a free trial at pythonbytes.fm slash datadog, or just click the link in your podcast player show notes uh brian let's talk about logos sure um i tried to pull i tried to pull this up but uh we're suffering some uh downtime there we go there we go um so the there's a article called uh reinventing the python logo and i thought it was a i thought it was interesting mostly about the history. I guess I hadn't thought about it too much. So the history really is
Starting point is 00:24:31 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 does look like marshmallows.
Starting point is 00:24:45 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 literally that's it. And apparently that passed for a while.
Starting point is 00:25:01 And then the current logo came into play into play in 2006 by and it was designed by tim parkland and uh it's the logo that we have right now um and i was you know i kind of got the the uh the uh mayan vibe from the 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 uh the symmetry also kind of reminds me of a yin yang symbol or something uh anyway i like it it's good but uh the article then goes on to talk to a talk
Starting point is 00:25:52 to a you a designer who came up with a possible change and proposed a change in 2020 uh jessica williamson and um it's pretty uh 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 was curious what you guys thought. Jeremy, go ahead. I mean, I've, I've grown, I've grown so used to the, grown so used to the other one, but I try not to be a, I try not to be a curmudgeon and, and, and like new things. I know, 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.
Starting point is 00:26:31 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 existing folks think is less of a concern 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.
Starting point is 00:26:56 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 has a gradient. Then you got gradients on gradients are hard to combine. Whereas like this, 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.
Starting point is 00:27:13 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 those little holes? Those are the eyes. It didn't happen to have those.
Starting point is 00:27:33 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 started that way. Well, those are one of those things where if you don't, if you don't defend it, then you have a case that you can start to lose it as to where you're like,
Starting point is 00:28:08 well, you never made a case of it before. And so 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
Starting point is 00:28:18 for the training courses, I had to go back and forth and prove that 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 change of colors. They are, you know, funky redesigns.
Starting point is 00:28:37 They're like these weird things are slightly different shape like this one. Ooh, not okay. 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. Ooh, the exercises one is not okay. The one with the barbell? Yeah. Or the plate stack? 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.
Starting point is 00:29:05 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, and you know, the rules aren't really that complicated, though. They're mostly, the logo has to appear in the same colors and it has to has to be visible and in its whole without something in front of it yeah so 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 um and they're
Starting point is 00:29:35 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 okay and you can get pre-approval for stuff. But yeah. And so now mine is approved and I feel much better about it, but I had no idea that 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 or use pip indirectly it indirectly behind the scenes goes to pi.pi and does all of its magic. You pip install this, install that. And it would be great if we could put, use that as a mechanism to communicate across teams or companies, right?
Starting point is 00:30:17 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.
Starting point is 00:30:57 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. Yeah. So there's not a whole lot to talk about it. Do you know if it acts like a caching server as well? So can you get...
Starting point is 00:31:17 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. You're saying you'd like to just set that as the global destination. If you install requests, it pulls it from...
Starting point is 00:31:32 You want to pull the public stuff in plus merge your private stuff with it, right? I haven't tried that, but I suspect PyPI Cloud does allow that. 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
Starting point is 00:31:51 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 seems pretty neat. Yeah. All right. Next up, we have not just the basics, but beyond. Yeah. So if you've read some of El Swigert's other Python books, there's a new one, I believe, dropped January. That's the month that we're in.
Starting point is 00:32:27 Can grab from NoStarchPress 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 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.
Starting point is 00:33:05 Yeah. Raised by technical wolves. So often when you- I love that way of thinking. That's awesome. 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 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,
Starting point is 00:33:43 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 in 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 magic number earlier. You're like, well, why is that bad? I did the math already. It doesn't make sense to do the, yeah, I guess back to the, um, back to the magic number earlier. You're like, well, why is, well, why is that bad? I, I did the math already.
Starting point is 00:34:07 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. Cause it's probably going to be you who comes behind you and reads that later and doesn't remember. And so, um, yeah, chapter after chapter, it's just so many things that are like, oh, again, like code formatting, like if you haven't been using formatting and linting prior and makes it so much easier to interact with other folks and sort of helps you knock those rough edges off
Starting point is 00:34:38 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 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 it. Right, right. Even probably things like continuous integration and stuff, you should probably know, or Git or PRs or all those. If you've kind of been doing that on your own, you can in some organizations do, but many people don't create PRs for themselves. They just check in and carry on, right? So those kinds of things. Yeah, this is great. And you can read it online or with the do but many people don't create prs for themselves they just check in and carry on right uh so so those kind of things yeah this is great you can read it online or uh with the link in the show
Starting point is 00:35:09 notes or you can go buy it uh yeah it's on no starch uh you can either get like the ebook you can get printed copy whatever you're uh 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 ew 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 if it's if it's dead delete it well we might need it later that's what version controls for we can go back and get it later
Starting point is 00:35:48 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 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 uh 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 exactly i don't have a problem i just have 23 cats it's gonna be all good uh all right oh awesome well so uh let's talk about just a few extra things that he wants to throw out there brian anything else um we got a uh feedback i'm sorry i can't remember the guy's
Starting point is 00:36:32 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 uh and i made a comment that be cool to have this but not have it list pip chill because i only installed it for this and so yeah he added a no chill option so that's nice and self-aware pip kill 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 it's all good oh and uh yeah piling says he's been using um pipchill so cool cool yeah i love the idea of it but i haven't yet made
Starting point is 00:37:24 it into my workflow jeremy you got any quick extras you want to throw out there? Yeah. 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 talks on Nate Smith had made prosaic, which is a Python for doing 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,
Starting point is 00:38:10 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 twenty five, twenty four, twenty,000 times at this point. And the machine learning is more wisdom of crowds. Like I'll get notifications like, oh, someone put favorites on them. Maybe it happened upon a good one in the large pile of terrible ones. Fantastic. You have to put that in the show notes.
Starting point is 00:38:39 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 gonna beetlejuice the bot uh and then i suppose also on um on the twitter front yeah we just told you not to scroll forever. But my favorite client just got a refresh. If you use iOS devices, the TapBots folks have put out TweetBot number six yesterday. Oh, nice. Yeah. That's cool.
Starting point is 00:39:17 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. A bunch of cool new features coming in Django. You can check those out. MyPy 0.8 has just come out and that has Python 3.9 support. PIP 21 is out and that drops Python 2 support. So that's also a good one more step away from legacy Python.
Starting point is 00:39:46 And then real quickly, there's Elasticsearch. They changed their open source model, which is a very, I'm not going to say is bad. 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, Elasticsearch as a service.
Starting point is 00:40:07 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.
Starting point is 00:40:24 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 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 part of that was unsaid was that amazon said fine take your toys and do take your toys and sell your service, but we'll just fork it and continue to do the thing. They forked it with the old model before it's changed. It got in there and that was that, right?
Starting point is 00:40:53 And that was similar to what they did with Mongo, I think. They basically said, we have a thing that is API compatible at 3.6 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 on to it i just wanted to throw that out there as something people would
Starting point is 00:41:17 be paying attention but people that use it internally or on their own servers that there's there's no problem with it right yeah yeah Yeah, 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?
Starting point is 00:41:31 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.
Starting point is 00:41:42 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. 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.
Starting point is 00:42:14 But I think it used to be a lot longer. 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 that's been laying around for a few days. That's the three-day rule. Yeah. You want to keep that pretty short. 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.
Starting point is 00:42:49 Come on. Oh, boy. All right, guys. Maybe somebody can correct me with the real story. Yeah, that's what happens on the show. We throw out bits of information and our listeners back us up. All right, Brian. Thanks as always.
Starting point is 00:43:02 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
Starting point is 00:43:18 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.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.