Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book


Transcript #218: Keyboards for developers, Python, and some history

Return to episode page view on github
Recorded on Wednesday, Jan 27, 2021.

00:00 - Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.

00:05 This is episode 218, recorded January 27th, 2021.

00:10 I'm Michael Kennedy.

00:11 - And I'm Brian Rotkin.

00:12 - And Brian, we have a special guest, Jeremy Tanner.

00:14 Welcome, man.

00:15 - Thank you, thank you for having me.

00:16 - Yeah, it's really great to have you here.

00:18 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 gonna have to like drag you into our world to actually get to catch up.

00:28 It's good. I need a tiny bit of that Portland fix.

00:31 I loved being up there, but I mean the entire Pacific Northwest, but Portland in particular.

00:35 And so, yeah.

00:36 - So where are you at?

00:37 - I am in Austin, Texas.

00:39 - He's in the Portland of the South.

00:40 - I thought that was, oh yeah.

00:42 - Nice. All right.

00:43 Well, maybe real quick, tell us about yourself, Jeremy, people who don't know you.

00:49 - Absolutely.

00:50 I like motorcycles.

00:52 I like suede shoes.

00:53 I like smoked meat, like Python.

00:56 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.

01:12 - Yeah, yeah.

01:13 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.

01:27 Like that's a really neat, a neat thing to do when you're otherwise just stuck at home.

01:31 - It's a, we have, there's so many like technology guardrails, right?

01:34 Like turning your phone screen to gray scale.

01:37 So it'll be less enticing, turning off your notifications, whatever else.

01:40 But the really nice thing about riding a motorcycle is the guardrails aren't there and you absolutely have to be paying full attention.

01:50 So it's not all, I'm also thinking about something else.

01:52 You're like, well, do you not want to die?

01:54 then like watch the road, be aware of everything.

01:58 And so it forces everything to the background for however long you can manage it.

02:01 - 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.

02:09 All right, well, Brian, I believe you have the first item.

02:12 Something, is this about laundry or what is up here?

02:16 - Constant folding, of course, yeah, laundry.

02:18 Well, I do like the little animated sloth holding something, it's nice.

02:24 - No, I brought this up because, so it's an interesting article about constant folding.

02:29 So constant folding is when a language replaces your constant expressions at compile time rather than computing them at runtime.

02:38 So if I say something like, you know, 24 times 60 or whatever, it'll just replace that.

02:44 - Wait, wait, wait, let me, did you just say compiling?

02:47 - Yeah, so that's-- - Like when I compile, like what is that, GCPY, GPY?

02:51 Like how do I, no, I mean, this is a misconception.

02:54 I think a lot of people have is like languages like Python don't actually get compiled.

02:57 They do.

02:58 Well, there's the bytecode compiler, right?

03:00 So and I and that happens.

03:03 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.

03:08 So that doesn't really there's not really a pre thing.

03:11 But if you've got an installed package or or lots of stuff that gets run for a long time.

03:18 Yeah, that bytecode will happen once bytecode conversion.

03:21 What is that called?

03:22 Is that compiling?

03:23 >> Yeah, I think so.

03:24 But it just doesn't compile to machine instructions.

03:26 It compiles a byte code like Java or .NET, but then what happens is it doesn't JIT compile, it just interprets it from there on.

03:32 Yeah, I think there's levels, but it's automatic and hidden, which is cool.

03:36 >> Well, CPython at the very least has this notion of constant folding where it just comes up with your expressions and does it at the compile time instead.

03:48 It's something that I don't really think about in Python.

03:52 I definitely think I know what's happening in C, in C++.

03:57 We got the pre-compiler going on, but it does happen and you can see it in action in this article talks about it.

04:04 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.

04:15 And so something like, you know, if you recommend, One of the examples was the days in seconds is 24 times 60 times 60.

04:25 And then the Python will just convert that to, what is it, 86400.

04:31 Now, I'm bringing this up, like one of the things, this is kind of an interesting article about really how it does it.

04:38 And the rest of the article kind of goes into, you know, the implementation on CPython of how the folding happens.

04:45 And that's interesting, But mostly the reason why I brought this up is because I want people to remember that this happens.

04:51 So if like for this example, it is way better to put in your code days in seconds equals 24 times 60 times 60.

05:00 That's really clear.

05:01 You don't really have to comment it much because people can just look at it.

05:04 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?

05:14 What happens if I change it?

05:15 it's going to mock 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.

05:39 Yeah, 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.

05:50 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?

05:56 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.

06:07 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, but if you make it 4097, it doesn't do the folding at that point.

06:22 I don't think you have to memorize that.

06:23 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, do it at runtime.

06:31 - Yeah, yeah, it makes a lot of sense.

06:32 Perfect, I like it.

06:33 And you know, it's another cool chance just play with the disassembler and understand that a little bit better.

06:38 Jeremy, you ever play with disassemble things?

06:40 No, but was appreciated that the it was a way to avoid a little of the magic number disaster where had 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 with nuclear reactors, then yeah, you'll you'll know you'll know why these pieces are here.

07:02 I please name them things.

07:04 Yes, exactly.

07:05 Here's the number of moles of or whatever in chemistry.

07:10 Like it doesn't make any sense, right?

07:11 So if you kind of do a calculation, but you don't have to pay for the calculation.

07:14 That's, that's really nice.

07:15 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.

07:23 I would say date time dot total seconds divided by seconds and days.

07:26 Well, that's how many days it is until Paul was on talk Python, the guy behind the date time 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.

07:44 Like that's just crazy.

07:45 (laughing)

07:46 How was I supposed to know I could do that?

07:48 So, but yeah, this is definitely a cool one and the disassemblers need 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.C, which loop and that's your program.

08:03 All right.

08:03 - 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 kind of fun to look at the output of the disassembler.

08:20 - Yeah, yeah, definitely.

08:21 It gives you that inside view.

08:22 All right.

08:23 I stole this from you, Brian.

08:24 It's a good one.

08:25 - It's a good one.

08:26 - So this one is called hip review.

08:30 And PipReview is really cool.

08:32 I learned about this from PyCoders, the newsletter.

08:34 And the idea is that updating all of your packages that you've got in a virtual environment is a hassle in various ways.

08:41 One way is I could just not set, you know, I could not pin the version numbers and just install the latest, right?

08:48 But then if I try to reinstall, it just says, you know, those are up to date.

08:53 Maybe I see, oh, I know that there's an update for HTTPX.

08:56 So I'll do a pip install -u pipx, right?

08:59 upgrade and it'll upgrade it, but it won't upgrade the things that pipx installed.

09:04 Even if I ask pipx 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 pip review, which lets you smoothly see all the available updates and then apply those. This used to be part of pip tools, but it's now its own standalone thing that just directly uses pip.

09:25 So like all good things, you pip install pip review, which is very meta, and then you have pip review.

09:31 And then you can just ask it to do things like just run pip dash review on the command prompt terminal.

09:38 And it'll tell you, you've got this version of this library, there's a new one available.

09:41 And that's pretty much equivalent to doing pip list dash outdated.

09:45 But then you can also just say, and fix it.

09:47 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.

09:56 It'll also let you do this in an interactive way.

09:59 So you can say dash dash interactive and it'll say this is out of date.

10:02 Do you want to upgrade it?

10:02 Yes or no.

10:03 NumPy is out of date.

10:04 Do you want to update it?

10:05 Pandas is out of date.

10:06 Do you want to update it?

10:06 And so on.

10:07 And you can selectively opt into those.

10:09 And then you can even come up with a constants file that says, you know, please don't update these automatically.

10:15 They're stuck in an old version for whatever reason, pinned to a certain version.

10:18 What do you guys think?

10:19 I hear NumPy and Pandas and Matplotlib.

10:23 And it's all the flashbacks, right?

10:25 I think we met before time when I was at Anaconda.

10:30 And so I mean, since this certainly looks interesting and solving problems.

10:37 But on my end, still very much, especially for scientific Python bits, a conda loyalist, both for package management and for environment management.

10:50 - Yeah, that's a whole different side of things.

10:52 And Konda definitely managed that quite a bit, right?

10:55 Like it's all about, you can open up your navigator and create your environments and interact with those in that way as well.

11:01 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.

11:08 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.

11:16 but that's always going through like some external workflow.

11:18 And this is just like, well, I don't want to go through that.

11:20 I just want to right now find the new stuff and change it or don't.

11:24 Yeah.

11:24 I tried this out on a project of mine that uses, uses, you know, flit and, the PI project atomal to define, the, a couple pinned versions of things.

11:35 So I wanted to check to see if they're out of date.

11:37 and I tried the pip review auto, to just auto update them.

11:41 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.

11:52 So just be aware, you need to figure out that conflict on your own.

11:56 - Oh, interesting.

11:57 Okay.

11:58 Yeah, yeah, very nice.

11:59 Yeah, I've recently run into some issues with the resolver and the new, yeah, we've gone over that.

12:04 Nice, all right.

12:06 Jeremy, what's your first one?

12:07 Keyboards.

12:08 - My first one is keyboards.

12:09 And so I have fallen well down the mechanical keyboard rabbit hole.

12:14 You want a loud clackity, clackity, clackity, clack version?

12:18 Just like such, yes.

12:21 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.

12:30 And so...

12:31 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.

12:37 So it makes sense.

12:38 So I've fallen to mechanical keyboards mostly to try and get my wrists to be less hurdy.

12:43 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.

12:50 I may show you keyboards, but I'll have to remember to describe those.

12:55 That's right.

12:56 Have started to really love mechanical keyboards for ergonomic improvements and ability to sort of restructure the way that they work for my benefit.

13:08 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--

13:16 - Everything wrong, everything wrong that you could do, right?

13:20 - Do you know when QWERTY came into usage?

13:23 - Yeah, I mean, very clackety, right?

13:25 For the, to slow down the typewriter.

13:28 - Yeah, but in, it was in 1873, and so like Civil War era.

13:32 Like back in a back in, I mean, within 10 years of the first American Civil War.

13:37 So when, we were still like settling our disputes with like swords on horses and, and so on.

13:45 And, just like there's always a continues to be a better way of doing things.

13:49 And we keep on working towards the better way.

13:51 Like, the layout of keyboards is sort of a vestige of a pastime with different requirements.

13:56 Kind of like wearing pants now, right?

13:58 Like we used to be going out and seeing people now.

14:01 shorts.

14:02 >> Let the missions breathe.

14:03 >> Exactly.

14:04 >> Anyway, what's useful on the keyboards is, in addition to getting ergonomic benefits, you can change up your key map.

14:12 Normal keyboards have maybe 100 keys on them or so, but they really have 200, maybe 300 keys.

14:18 You have modifier keys.

14:19 You push shift and you're like, "Okay, now all the letter keys are now capitals.

14:24 The one is an exclamation point," and so on.

14:27 Key maps are the ways that you can take and change the those keys to what you wanted to do.

14:33 Like, yeah, if you want to say switch to Dvorak or something along those lines, right?

14:39 I had a friend who taught himself to Dvorak, but seeing the QWERTY keys was so impossible for him.

14:43 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.

14:49 That's that's sort of what's going on over here.

14:51 This is a, a 44 key split.

14:56 And you got to describe that to people.

14:58 First of all, what is that?

14:59 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.

15:11 Jesse and Kai 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.

15:25 And so for this keyboard, you're going to operate largely with layers.

15:30 And so you don't see as many symbols or numbers here.

15:33 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.

15:50 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, that the hash symbol, That's going to need to go somewhere.

15:59 Well, you need to add it on and the keyboard keeps growing.

16:03 Here, your hands stay in about the same position, but when you put your ring finger down on the home row, the of your left hand, the entire right side changes to different keys.

16:17 The way, suppose the Python tie in there is that most of these keyboard firmwares are written in C because you the little microcontrollers under that's telling what key is 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, "Okay, which keys am I pressing most frequently?

16:56 Let me move those to a stronger finger." Again, because we're home in quarantine, pandemic time, it's fun to have this escape room to get yourself out of, and there's a little bit of a challenge to remember where that new key is.

17:12 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.

17:25 You can go with split hand boards.

17:27 They center that up into the interview.

17:30 This is for those who are listening.

17:32 RGB, KB, Sol, the like the sun.

17:36 So you basically have two separate pieces.

17:39 Oh, and it has LEDs. Beautiful.

17:42 So you have two chunks, one for each hand.

17:44 You can position them.

17:45 Yes, it's for you. OK.

17:46 Yeah. And so it can open up your open up your shoulders, open up your upper body a little bit.

17:51 Hopefully make your wrists less hurty was the.

17:54 Yeah, well, I used to I've struggled for and I gotta do math for 20 years, maybe 15 years with RSI issues.

18:02 And it's mean it was to the point where I had surgery on my right hand for carpal tunnel stuff.

18:06 And man, what am I going to do? I did physical therapy, it was really quite scary, actually.

18:10 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.

18:21 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.

18:32 Do you use one of the sideways?

18:33 The I cannot find a good sideways left handed one. Oh, that's so super hard. It's 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.

18:53 I don't go anywhere without it.

18:54 So yeah, I think that's an important thing.

18:56 You're good.

18:57 The best way to fix it is to touch your computer less.

19:00 But if that's not an option.

19:02 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.

19:13 Or you can try and not look into the abyss so often.

19:17 Yeah, I've used voice typing.

19:19 Go ahead, Brian.

19:20 doing a lot of less doom scrolling now than I used to. So yeah, I think they're less crazy.

19:25 Brian, what do you got for your setup? You just type on your MacBook or you got something better?

19:29 Me?

19:30 Yeah.

19:30 Oh, Kinesis.

19:32 Oh my gosh, you are full on over there, dude.

19:34 Yeah, so...

19:36 Okay.

19:36 Dishes. Yeah.

19:37 So I've...

19:37 Yeah, those are like the hollowed out, like typing in a crater.

19:40 Yeah. So I've been using Kinesis for like 30 years, 25 years.

19:44 Wow.

19:45 And similar, I had problems with my arms.

19:50 And I was just a couple of years into my career.

19:53 And I'm like, oh my god, I finally get a programming job and I can't do it anymore.

19:59 But I switched to the left-handed mouse.

20:01 And now I don't even think about it.

20:03 Some people say, I don't switch the mappings.

20:07 I don't switch the left to right.

20:08 I just move the mouse over and use it with my left hand.

20:11 And then also the kinesis.

20:13 And then when the whole mechanical keyboard thing started, people were talking about that.

20:18 Like, what's all this about?

20:20 And then I found out that the Kinesis has been mechanical since it started.

20:25 Yeah.

20:26 Kinesis is definitely an interesting one.

20:28 Although I think I want to get a new one because the key, whatever the mechanics behind it, are the wrong color or something.

20:38 I want to get ones that I have to push down a little harder 'cause I find that I rest my hands on my keyboard and it'll start typing stuff.

20:45 So I'd like to have it be more hard to push down.

20:49 - I think there's probably three things that you can do.

20:51 You can either crack your switches open and put in heavier springs.

20:55 You can get a key switch puller and pull out the switches and plug in.

21:00 Depends if they're hot swappable or if they're soldered down into the board.

21:04 And so I am 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 ErgoDex ones are hot swappable.

21:17 So you can take a puller in.

21:18 I have not in front of me, but over and over in a bin, different key switches that I've tried.

21:24 Some that are quieter, some that are louder, some that are heavier, some, some that are really light.

21:29 And yeah, eventually you figure out the sort of the Goldilocks situation.

21:33 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.

21:39 There's maybe three like it that are just like you.

21:42 Fantastic. Yeah.

21:44 Magnus Carlsen, Magnus Carlsen says he has a old ergo docks over in the corner right on.

21:51 Why is it in the corner?

21:52 Don't put baby in the corner.

21:54 Yes. Get those.

21:55 Love those wrists.

21:56 Yeah, the one that I love.

21:57 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.

22:05 I feel like you've got to move them a lot, which I don't know.

22:07 It's always a balance.

22:08 This one works well for me, but all of these things are super fascinating.

22:11 - Yeah, there's switches with adjustable travel.

22:15 And so over, you can cut probably more than a millimeter out of it going from two down to either one or maybe even 0.8.

22:22 - Oh wow.

22:23 - So you can tune it exactly to what you're after.

22:26 - I tried yours, Michael.

22:28 I have one of those, whatever that you've got.

22:32 - Yeah, the scoped ergonomic or whatever it's called.

22:35 - But it's a Bluetooth one and I can't do Bluetooth keyboards.

22:39 The Bluetooth delay gets me.

22:42 You'd think that I wouldn't be able to notice, but I notice and I don't like it.

22:46 - Yeah, wouldn't it be nice if you could buy keyboards, wires?

22:49 - And then I suppose we didn't talk about mousing either.

22:53 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.

23:03 And so both any of your keyboard keys can make it travel diagonally or up and down or can be used as click.

23:09 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.

23:18 - Sounds awesome.

23:19 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.

23:26 All right, now before we get on the next item, Let me tell you all about our sponsor for this week, Datadog.

23:31 Thank you Datadog for sponsoring the show.

23:34 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.

23:42 They seamlessly correlate logs and traces across individual requests and you can quickly troubleshoot your Python app.

23:49 Plus their continuous profiler allows you to find the most memory and CPU consuming parts of your production code continuously.

23:56 Just run it all the time, minimum overhead, pretty awesome.

23:59 You'll be the hero that got that app back on track at your company.

24:02 Get started today with a free trial at pythonbytes.fm/datadog, or just click the link in your podcast player show notes.

24:08 Brian, let's talk about logos.

24:10 - Sure.

24:11 Oh, I appreciate it.

24:12 - I tried to pull this up, but we're suffering some downtime.

24:16 There we go, there we go.

24:18 - So there's a article called "Reinventing the Python Logo," and I thought it was interesting mostly by the about the history. I guess I hadn't 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, it's not 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 really that's it and apparently that passed for a while and then the current logo came into 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 the a Mayan vibe from the Python icon also, or the two Pythons.

25:23 But there's a quote from Tim.

25:25 It said, "The logo is actually based on a Mayan representation of snakes, which is very often represented only--

25:31 represent only the head and perhaps a short length of tail.

25:34 The structure of the snake represents the natural coiling nesting of a snake as seen on the side." I don't know.

25:41 But having the symmetry also kind of reminds me of a yin-yang symbol or something.

25:47 Anyway, I like it, it's good.

25:49 But the article then goes on to talk to a designer who came up with a possible change and proposed a change in 2020, Jessica Williamson, and it's pretty.

26:04 But I didn't really read the rest, I just thought it was curious to think about, should we change it?

26:08 And I guess I'm on the side of, I kind of like the way it is, but I was curious what you guys thought.

26:13 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 have ever used it up to this point. And so, what the existing folks think is less of a concern if it feels newer or more welcoming.

26:45 - Yeah, if it pulls people in and it makes them feel like, oh, this is a fresh language, right?

26:49 This is like one of the most popular, fastest growing languages in the world.

26:52 Of course it has this logo.

26:54 I don't dislike it.

26:55 I think it's pretty nice.

26:56 I like the colors.

26:57 I like the flair, but I feel like those gradients, those gradients are hard to combine.

27:01 Whereas like this sort of flat color, you can put it in with other things.

27:04 But like, imagine like the thing you're trying to put the logo on also as a gradient.

27:08 Then you got gradients on gradients.

27:09 It just, it seems a little slightly less versatile.

27:12 I like that.

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.

27:22 For example, I used to have a logo that looked like the main Python logo, but it had earbuds on.

27:28 However, it didn't have those little holes, right?

27:31 You see those little holes, there's the eyes.

27:32 It didn't happen to have those.

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.

27:42 Oh, wow.

27:43 Because I used a logo that wasn't an exact, it was an alteration of the Python logo, not the exact one.

27:49 Fair.

27:50 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.

27:58 We just have a conversation instead of started that way.

28:00 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 like.

28:08 Well, you never you never made a case of it before, and so you you kind of have to.

28:11 Yeah, exactly.

28:12 Don't separate the snakes.

28:14 Don't make one snake bigger.

28:15 You can't.

28:15 Right.

28:16 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.

28:27 And yet, have you all looked at what is in the app stores?

28:31 I they are.

28:32 They are change of colors.

28:33 They are, you know, funky redesigns.

28:37 that are like these weird things are slightly different shape like this one.

28:40 Oh, not OK.

28:41 There's just a couple of pages.

28:43 There's like 15 companies violating the trademark.

28:46 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.

28:52 Anyway, the exercises one is is is not is not OK.

28:56 The one with the barbell.

28:58 Yeah, the one is totally not good.

29:01 They're all not good.

29:02 I'll put the link in the show notes for those of you guys who can't see it.

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?

29:13 It's quite a bit of stuff around it legally speaking.

29:15 >> Yeah. The rules aren't really that complicated though.

29:19 They're mostly the logo has to appear in the same colors and it has to be visible and in its whole without something in front of it.

29:28 >> You can't shift though, it can't be squished.

29:31 Mine, the perspective was slightly off for some reason, and that was also part of the complaint.

29:35 - 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 okay?

29:42 And you can get pre-approval for stuff.

29:45 - Yeah, so now mine is approved and I feel much better about it.

29:48 But I had no idea, I just came out of the blue.

29:50 So there it is.

29:52 But if anyone wants to start forcing those, they should go have a look at the app stores, they're out of control.

29:56 All right, what's not out of control is somewhat related is pypi.org, it's pretty awesome, right?

30:02 So we go to PyPI and our use pip it indirectly behind the scenes goes to PyPI and does all of its magic.

30:08 You pip install this, install that.

30:10 And it would be great if we could put, use that as a mechanism to communicate across teams or companies, right?

30:17 One team built some sort of API interface layer and some other part wants to consume it at your company.

30:24 But you probably don't want to put that in the public repository.

30:27 It might have secrets.

30:28 It might just be inappropriate, all those kinds of things.

30:31 So it would be nice to have your very own, right?

30:33 - Yeah, absolutely.

30:35 - Yeah, so introducing AWS Lambda PyPI.

30:39 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.

30:52 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.

31:00 So you can basically set up PyPI Cloud to run automatically as an AWS Lambda, which then you can lock down.

31:07 That's pretty awesome, right?

31:08 - Yeah. - Yeah.

31:09 So there's not a whole lot to talk about it.

31:13 - You know if it acts like a caching server as well, so can you get-

31:18 - You probably could.

31:19 You probably could do that with PyPI Cloud.

31:22 It's just rehosting PyPI Cloud, which I'm guessing it can.

31:24 I don't know for certain, but so you're saying like, you'd like to just set that as the global destination.

31:29 - Oh right, I wanted to store my private stuff.

31:32 - Yeah, you wanted to pull the public stuff in plus, like sort of merge your private stuff with it, right?

31:37 - Yeah.

31:38 - I haven't tried that, but I suspect PyPI Cloud does allow that.

31:41 So the security wise, it says the session keys are auto-generated and stored in a secret.

31:47 The server configuration contains those generated on the fly.

31:51 The Lambda functions can be limited to accessing only what it needs.

31:54 And then of course you can configure PyPI Cloud to display nothing to non-authenticated users.

31:59 So you basically have to log into it and then you're good to go.

32:02 So I think this is a pretty neat solution.

32:04 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.

32:10 - Yeah.

32:11 - All right.

32:12 Next up we have not just the basics, but beyond.

32:16 - Yeah.

32:16 So if you've read some of L. Sweigart's other Python books, there's a new one, I believe dropped January.

32:25 that's the month that we're in, can grab from NoStarchPress or can give a look over at the URL above.

32:33 And so many other books and references are like, here's how to do the thing, go on.

32:38 Here's how to do the thing, go on.

32:40 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.

32:54 And so, so often it's easy to get into that.

32:57 - Give us your interpretation of that.

32:58 That's like, you've just been out on your own, you've figured out how to make it work, but you don't necessarily follow the community.

33:04 - Raised by technical wolves.

33:09 So, so often when you-

33:11 - I love that way of thinking, that's awesome.

33:13 - 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 make you look less polished, whether that's in a code interview.

33:30 And so when Al goes over, what are reasonable variable names?

33:36 What are code smells?

33:38 Talking about like the duplicating code or what are...

33:41 So you can write something that works very easily, but here are things that it's gonna be so much nicer to hear from Al, like, "Hey, you probably don't wanna 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.

34:03 You're like, "Well, why is that bad?

34:06 I did the math already.

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.

34:12 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.

34:28 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 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 didn't know you needed to know.

34:50 - Right, right.

34:51 Even probably things like continuous integration and stuff you should probably know or get or PRs or all those, like if you've kind of been doing it on your own, like you can in some organizations do, but many people don't create PRs for themselves.

35:02 They just check in and carry on, right?

35:05 So those kinds of things.

35:06 Yeah, this is great.

35:07 And you can read it online or with the link in the show notes, or you can go buy it online.

35:11 - Yeah, it's on NoStarch.

35:12 You can either get like the ebook, you can get printed copy, whatever you're into.

35:16 >> Yeah, and I think that I was just looking through the code smells one, even people just review that, anything else.

35:23 This is some pretty good stuff.

35:24 >> Yeah, I love the idea of code smells so much.

35:27 Because it's not wrong, just turns you know that, "Ew, this isn't so good, but it does work." >> Yeah. One of the big ones that I run into at work even a lot is commented out code.

35:40 People comment something out and then check it in.

35:43 If it's dead, delete it.

35:44 Well, we might need it later.

35:46 That's our version controls for we can go back and get it later.

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.

35:55 >> Yeah.

35:56 >> Yeah, or worse, don't comment it out, just stop using it, but don't delete it either.

35:59 >> Or dead functions.

36:01 >> Yeah, a dead function or dead class. Oh my goodness.

36:03 >> Oh yeah, I'll see that occasionally.

36:05 Somebody will rename a function like function foo old.

36:09 Why did you do that? Well, we're not using it right now.

36:12 There's better ways to remove some.

36:14 That hoarder type code base.

36:15 (laughing)

36:16 - Exactly, exactly.

36:18 I don't have a problem, I just have 23 cats.

36:19 It's gonna be all good.

36:20 (laughing)

36:22 All right, oh, awesome.

36:23 Well, so let's talk about just a few extra things that he wants to throw out there.

36:27 Brian, anything else?

36:29 - We got a feedback, sorry, I can't remember the guy's name, but in episode 208, we covered pipchill, which is a way to list out your dependencies, but only the top level ones.

36:40 And I made a comment that it'd be cool to have this, but not have it list pip Chill 'cause I only installed it for this.

36:48 And so yeah, he added a no chill option.

36:50 So that's nice.

36:51 (laughing)

36:52 - And self-aware pip Chill.

36:54 - And then just before this, I was on these Microsoft Developer Twitch channel.

36:59 So that's a fun thing, the Microsoft Developer Twitch TV, they do it weekly, but don't watch them because you'll collide with watching us.

37:08 So, you know.

37:09 - Oh yeah, well, they need to move their time or something like that.

37:12 (laughing)

37:14 - It's both recorded, it's all good, it's all good.

37:17 Oh, and yeah, PyLang says he's been using PipJill.

37:20 So cool, cool, cool.

37:21 Yeah, I love the idea of it, but I haven't yet made it into my workflow.

37:25 Jeremy, you got any quick extras you wanna throw out there?

37:27 We covered it all.

37:28 - Yeah, 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 learning Twitter bots.

37:36 And yeah, if like any of those that can be cooked up, always a good time.

37:40 It made me think of one of the previous times I was in Portland at one of the conferences.

37:45 There was talks on Nate Smith had made prosaic, which is a Python for doing cut and paste poetry.

37:55 And so you have any corpus of information you can take and chunk it down.

37:59 That's paired with a Twitter bot.

38:01 So I went to look back because it's been a while.

38:03 I have a Twitter bot that's still running, just called Hitch_Haiku on Twitter.

38:08 So every hour on the 42nd minute, it takes all five books from the trilogy and pulls a five syllables, seven syllables, five syllables out, combines them all together and puts that into the world, I think about 24, 25,000 times at this point.

38:26 And the machine learning is more wisdom of crowds.

38:29 Like I'll get notifications like, "Oh, someone put favorites on them.

38:33 Maybe it happened upon a good one in the large pile of terrible ones." Fantastic.

38:38 I'll have to put that in the show notes.

38:39 - The machine learning was funny.

38:40 I just found out that like there's a bot that if you say machine learning, it'll retweet you.

38:45 So I tried to install machine learning as much as I could and have it retweet, you know, the insights.

38:53 - Fantastic.

38:53 - Like you're gonna Beetlejuice the bot.

38:55 (laughing)

38:58 And then I suppose also on the Twitter front, yeah, we just told you not to scroll forever, but my favorite client just got a refresh.

39:08 if you use iOS devices, the Tapbots folks have put out a tweet bot number six yesterday.

39:15 - Ooh, nice.

39:15 - Yeah.

39:16 - That's cool.

39:17 Yeah, I got to explore more Twitter clients.

39:20 I'm still just a web browser kind of guy, but it works for me.

39:23 It works for me.

39:24 All right, I got a quick couple of releases for everyone.

39:25 Django 3.2 alpha one was just released.

39:28 So that's pretty awesome.

39:30 A bunch of cool new features coming in Django.

39:32 You can check those out.

39:33 Mypy 0.8 has just come out that has Python 3.9 support.

39:38 pip 21 is out and that drops Python 2 support.

39:42 So that's also a good one more step away from legacy Python.

39:47 And then real quickly, there's Elastic, Elasticsearch.

39:50 They changed their open source model, which is a very, I'm not gonna say is bad.

39:55 I kind of support them in this path, I think, but it's a very big deal.

39:59 You know, AWS and some of the other cloud vendors are like basically selling Elastic as a service, to last six searches of service.

40:07 And they're like, wait, you just took our stuff and are selling it to other people.

40:12 Whereas we have a corporate sort of thing, but we have no relationship with these people and that doesn't seem real fair.

40:17 MongoDB had exactly the same problem.

40:19 And so they adopted the same license, the SSDL or something like this.

40:24 Basically, it's still open source unless you want to resell it as a cloud vendor, then it's not.

40:29 I don't know.

40:30 How do you guys feel about this?

40:31 - Open source business models are hard.

40:33 - Yeah, yeah.

40:34 And it's really hard to attempt to put the genie back into the bottle after.

40:39 And so I think the part of that was unsaid was that Amazon said, "Fine, take your toys "and sell your service, but we'll just fork it "and continue to do the thing that we're doing." - They forked it with the old model before it's changed and got in there.

40:52 And that was that, right?

40:54 And that was similar to what they did with Mongo, I think.

40:56 They basically said, "We have a thing "that is API compatible at 3.6," or whatever level it froze at, right?

41:02 And then they went on from there.

41:03 - Yeah, it's tricky.

41:04 I think for some reason, Elastic has a relationship with Google Cloud and Azure.

41:09 And so they don't have that challenge with Azure, but they have no relationship with AWS.

41:13 So here it is.

41:14 Anyway, I don't wanna go that long onto it.

41:16 I just wanted to throw that out there as something people would be paying attention to.

41:18 - But people that use it internally or on their own servers, there's no problem with it, right?

41:24 - Yeah, yeah, that's my understanding.

41:25 You guys ready for a joke?

41:26 - Yes.

41:27 - Always.

41:28 - All right.

41:29 Brian, I feel like being a manager today.

41:30 Can you be the developer?

41:31 This comes to us from Kate Maddox.

41:34 Well, it comes to us via a guy named Wolf.

41:37 Send it over, thank you for that.

41:38 And it's written by Kate Maddox.

41:40 So all right, you be the developer, I'll be the manager.

41:42 - So I have good news and bad news.

41:45 - Oh, what's the good news?

41:46 - I've discovered that the five second rule only applies to food.

41:50 - Fantastic, but what's the bad news?

41:53 - I dropped our tables.

41:54 (laughing)

41:56 - Whoops.

41:57 Hope you all had backups.

42:00 - Oh boy, well.

42:02 - Did you hear that like, I probably have this wrong, but I think that the five second rule, I thought it was 10 second rule.

42:09 Anyway.

42:09 - It depends, it varies by age.

42:10 You know, if you're a little kid and it's candy, it's probably a good 30 second rule.

42:14 - But I think it used to be a lot longer.

42:17 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.

42:34 So, you know, probably not good to eat meat that's been laying around for a few days.

42:38 The three day rule.

42:40 - Yeah, you wanna keep that pretty short.

42:42 - Is it warm? - Get the magic number for number of seconds by number of days by cleanliness of floor.

42:46 - That's right, it's only 150,000 seconds, no more than that, come on.

42:50 Oh boy, all right guys.

42:52 - Maybe somebody can correct me with the real story.

42:55 - Yeah, that's what happens on the show.

42:57 We threw out bits of information and our listeners back us up.

43:00 All right, Brian, thanks as always.

43:02 Jeremy, it's great to catch up with you.

43:04 Thanks for being here.

43:05 >> Absolutely.

43:06 Thanks for having me.

43:07 >> You bet.

43:08 Bye.

43:09 Thank you for listening to Python Bytes.

43:10 Follow the show on Twitter via @PythonBytes.

43:13 That's Python Bytes as in B-Y-T-E-S.

43:16 And get the full show notes at PythonBytes.fm.

43:19 If you have a news item you want featured, just visit PythonBytes.fm and send it our way.

43:24 We're always on the lookout for sharing something cool.

43:27 On behalf of myself and Brian Okken, this is Michael Kennedy.

43:30 Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page