Python Bytes - #205 This is going to be a little bit awkward

Episode Date: October 31, 2020

Topics covered in this episode: Awkward arrays Ordered dict surprises jupyter lab autocomplete and more Open Source Tools & Data for Music Source Separation Pass by Reference in Python: Backgro...und and Best Practices Visualizing Git Concepts Extras Joke See the full show notes for this episode on the website at pythonbytes.fm/205

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 205, recorded October 21st. I'm Michael Kennedy. And I'm Brian Ocken. And this episode is brought to you by us. More about that later, how you can support what we're doing. Right now, Brian, I'm really sorry, man, but I've got something a little bit awkward to talk about. Well, this is awkward. I know, but luckily it's just you and me, so you don't mind if i just sort of tell it to you straight yeah just okay all right well sometimes i have an array and it's perfectly tabular like it's it's maybe just a linear array or sometimes the array goes
Starting point is 00:00:35 across like every entry is like 20 it's like a list with like 20 length 20 lists and it's all the right size but sometimes you know maybe it's it's the wrong shape and it's awkward and it's hard to deal with in python yeah you know a lot of array processing happens happens in numpy but numpy is all about rectangular like things and so if you've got data that's kind of like an array multi-dimensional array but it doesn't fit that shape what do you do oh i don't know simon thor sent us a message and said you all should talk about awkward arrays so awkward arrays this is uh it's actually a pretty advanced library so it's a little bit like numpy and it has numpy like idioms and so on but
Starting point is 00:01:20 it's a library for nested variable size data, including arbitrary length lists, records, mixed data types, missing data, and all those things. And dealing with those with NumPy-like idioms. So it's better for handling, like what I described, not the same shaped data. It's kind of the same dimensions, but it's not always the same length on the various parts. And you could even use it with things like Numba to jit compile the code to make it even faster and they just announced version 1.0 of this library which was originally written in python so it was good but not super super fast and they rewrote the core in c. So now it's like a lot of the data science stuff. C++, we're in the business end of the library,
Starting point is 00:02:09 so it's super fast. Nice. Yeah, pretty cool. And what do you think about the logo? The logo's actually great. It's an awkward array, but the second array is below awkward, and the A is capitalized,
Starting point is 00:02:21 so it sort of runs into the K and the W, and they have to squish out of the way. It's very clever. Kind of bent and awkward looking. Yeah, it's pretty clever. I like it as well. Another thing that I thought was interesting, if you open up the link over there, you don't have to,
Starting point is 00:02:34 but if you were to go there, like right on the page, it says here's the Python quick start. Oh, and here's the C++ quick start. So this library, the internals of it are written in C++, right? Okay. So that it's fast from python but also you can go straight to the template library side of c++ and use it directly if you are say building some stuff in c++ and also want to use this library or maybe you're building a library that does data sciency things and you have a big c++ c component aspect of it
Starting point is 00:03:03 you could use the c side of it directly there. Nice. Yeah, so that's actually something that I don't see almost ever is, here's the Python library and the C++ API that corresponds to it. Yeah, that's pretty cool. Also, I have a lot of cases for this.
Starting point is 00:03:17 I'm going to definitely check this out. This is great. Yeah, it's pretty cool. So thank you, Simon, for sending that in. Last quick note is when you install it, you pip install awkward the number one, not just awkward. I think awkward, which, my gosh, it's just so weird to have a package called awkward,
Starting point is 00:03:35 but it's great. Anyway, I think awkward is the older version and awkward one is this new 1.0 release. I think it's the same library. I wasn't sure if like, I was like, okay, if this is awkward one, what is just awkward by itself? That's got to even be more awkward, but I think it's the same library. It's just a different API version. Okay. Okay. Yeah. You might be surprised by it, but nonetheless, it's, it's pretty good library. Go and check it out. Yeah. You got any surprises for us? Yeah. The surprises came from Ned Batchelder. So Ned surprised us with some surprising ordered dict surprises.
Starting point is 00:04:10 So I think we've covered this, but in Python 3.6, dictionaries changed a little bit. So normal dictionary, if you just say dict or just declare one, they retain their insertion order. If you list them out again or just say if you have x equals some dictionary and print x on the REPL, it'll just print it in the same order it arrived in. Right. And if you do like 4k, v in dictionary.items, you'll get them in the same order now, which is nice. I think probably one of the most annoying things was if you are saving a dictionary, if you're going back and forth between a JSON file into a dictionary, then you save it again, right? Like that could just randomly be changing before,
Starting point is 00:04:53 whereas you'll be getting like, you know, diffs on that file. Anyway, like this stability is nice. I really like it, but I just sort of assumed, I knew there may have been some differences. There's still a collections.ordered dict that is around. It's still around, and there's a few reasons for it. One of them is just because it's a class that some other stuff derives from, and it would break backwards compatibility to remove it.
Starting point is 00:05:19 So I'm glad it's still there. But Ned brings up a couple surprising things around it. The first actually wasn't that surprising to me. They're ordered, but you can't get access to them by order. You can't say, give me the first one by saying, like, bracket zero or something. Does this surprise you?
Starting point is 00:05:35 It doesn't really surprise me. Not really. I mean, I would just do... I mean, it's a dictionary. Yeah, just get the first thing out of items, and then just be happy with that. I don't know. But yeah, there's no way to index bracket zero the dictionary.
Starting point is 00:05:49 Right, that's okay. The thing that actually I didn't really think about before was that Ned brings up is the how equality and order mix. So in the dictionaries for Python 3.6 and above now, if you declare two dictionaries with the same content, but they're created in a different order, they're still going to be equal.
Starting point is 00:06:12 So two dictionaries are equal if they have equal contents. It would super bug me. Like if I have A equals 1, B equals 2, or B equals 2, A equals 1. If the dictionary contents are the same, but the order changes and they're they say they're not equal that would i mean that would bug me i think right but order dict apparently it does matter so if you if you care about order you can use order to dict to make sure they're in the same order
Starting point is 00:06:36 yeah i guess you're explicitly saying i super care about order so if the order changes they're not the same yeah yeah so just a little surprise. Surprise. Surprise. But thanks, Ned. Yeah, that's cool. I wouldn't have known that. That's pretty neat. Speaking of knowing stuff,
Starting point is 00:06:52 you and I work on a few things. We've got some Patreon stuff going on. A lot of ways people can support us. Just really quick shout out, as a lot of people know, if you want to get better at Python, learn some things, check out training.talkpython.fm. we've got a ton of classes coming up on almost
Starting point is 00:07:07 200 hours of polished python content over there which is pretty crazy yeah and i love the content there we now have 55 supporters on patreon which is super cool and if you go to any of our show notes there's a patreon link on the side you can click on it and and a lot of people are just sending a buck a month and it's just awesome but it adds up and it helps out yeah thank you yeah it definitely helps out covers operating expenses like editing and transcripts and whatnot yeah so what you got next for us i have a follow-on to a follow-on to a follow-on how about that that's great yes so we spoke about black cell magic which is a way to type a thing into a cell in jupiter and have black formatted and a bunch of people said oh and there's this and there's that and there's all these great things and you covered i think it was
Starting point is 00:07:57 nb nbqa qa yeah i wasn't yeah i wasn't sure the last letter qa which is cool so that's kind of like a bigger set of tooling and other libraries along with black on top of that but one of the things that bugs me about jupyter notebooks is they just seem to lack some of this like proper editor support and black like format code is one of those but it's not the only one that bugs me and it took me a while to kind of get the zen of notebooks, like why do I create one of those instead of something else? And what's the flow? And I really do find them valuable, but it drives me crazy that if I type, you know, class object library dot, I just have to know, like there's no help. I have to know what I'm supposed to type. And then when I type it out, I say parentheses, and there's some number of arguments that go into this function call or whatever.
Starting point is 00:08:47 I have to just know the order, the type, the name, everything. Now, before someone mails in, I know I can type thing. And then press tab, and it'll come up in a list. But like this, like, please help me out on request. I don't know. It's like just typing. I should be able to just flow and not have to like, okay, type. Like, please help me out on request. I don't know. It's like just typing dot should just, I should be able to just flow and not have to like, okay, type.
Starting point is 00:09:08 And then, okay, now what's the documentation again for the signature? Where is it defined? All those kinds of things. So there's this cool project that was sent in by Anders Kalmer called JupyterLab LSP for Language Server Protocol Integration. It rolls right off the tongue. Language Server Protocol Integration for JupyterLab is its official name. But it's super cool.
Starting point is 00:09:35 It brings a lot of these things that I felt were missing from the Jupyter experience. So if you go there, you'll see that there's a bunch of examples, example code which shows Python. It actually works in R, you'll see that there's a bunch of examples, example code, which shows Python, it actually works in our bash TypeScript and a bunch of other languages. So here are some of the things that are supported. One, if I hover over a piece of code, if an underline appears, you can press control to get a tooltip with the function and function or class signature, you can get documentation and other information about it just by hovering. It'll show you like if you write code that's bad, like in Jupyter, if I write code that's bad, it just, it looks like code that's good, except for it won't run.
Starting point is 00:10:14 Whereas here to put little squigglies under it and say, there's something wrong with this, or there's a warning here, you're doing something wrong, right? So editor stuff like that. Jump to definition. So you can right click and say, take me to where this variable or this function is defined, which is pretty awesome. It'll highlight your references. If you place it on a variable, like in PyCharm, if you put got a variable and you put your cursor on it, like all the places where it's used or defined light up. So like that. Yeah. And auto completion. If I type the character dot, it will know that I want auto complete
Starting point is 00:10:49 so I don't have to keep typing stuff. That's pretty cool. And then on top of that, it has a rename, rename refactorings. So you can rename stuff across your, your, all your cells and things like that.
Starting point is 00:11:00 As well as files. So, you know, not groundbreaking world changing, but it definitely seems like that. Oh, definitely. As well as files. So, you know, not groundbreaking world changing, but it definitely seems like it will take it up a notch in your Jupyter experience, right? Just to bring it a little closer
Starting point is 00:11:11 to editors like PyCharm and VS Code. And it proves the point that the hardest thing in computer science is naming. That's right. We have a whole function when you get that wrong. That's what you do.
Starting point is 00:11:23 Yeah. But I mean, the name Jupiter. Jupiter. Jupiter dash. Jupiter lab dash LSP. Yes. Indeed. All right.
Starting point is 00:11:33 All right. What's this next one you got? Well, speaking of Jupiter, I guess it's a little related. This is a project that is implemented as a Jupiter book. I'm not sure if we covered Jupiter books, books, the Jupyter book project before, but it's a pretty neat documentation system. This is open source tools and data for music source separation.
Starting point is 00:11:54 I was researching music, Python music tools recently, came across this, and it's really cool. So what it is, it's an online book powered by JupyterBook. The authors are Ethan Manilow, Prem Sutherman, and Justin Solomon, I think. And it's a tutorial intended to guide people through modern open source tooling and data sets for running, evaluating, researching, and deploying source separation approaches and focuses on music.
Starting point is 00:12:24 Now, that's a mouthful, and maybe that's a limited set of people, but it's really neat. It uses Python, and it has interactive demos. Things with audio are way easier to visualize if you have a waveform in front of you, and this uses waveforms and stuff. It's beautiful. One of the things I wanted to highlight is there's a basics of source separation section.
Starting point is 00:12:46 And that includes a primer on digitizing audio signals. And it looks at frequency, time frequency representations, what phases, some evaluations and measurements. Anyway, I think this is the best reference for understanding digitizing signals that I've seen so far. It's really great. This is super cool. I think maybe the most generally useful thing at all, this is the whole Jupyter book way to create something like this for any knowledge base.
Starting point is 00:13:14 Yeah, I'd love to see how they do it. And it's a Creative Commons sort of thing. They got links to their GitHub repo, so anybody can see how they do this. So it's really cool. I like it. Yeah, yeah, it's super cool. And they do have it on, it's open source on do this so it's really cool i like it yeah yeah it's super cool and they do have it on it's open source on github so that's pretty sweet and i do have a complaint
Starting point is 00:13:30 though okay this is a big deal so there's a section in here on the basics of phase phase and phase trend like waveforms and what phases and so on there's some formulas in here where they define j to be the square root of negative one we all know that i is the square root of negative one come on i mean it's an imaginary number it doesn't start with j there's an i sorry carry on that phase thing is gorgeous it's got anyway yeah the animations and phase is actually really nice yeah to tell you the truth, I deal with signals all the time. And if you want to get into the math, the math is here. So this actually would be a great actual textbook for a university course.
Starting point is 00:14:13 But I just skip over the math part and read the explanations and stuff. It's still useful. Yeah, quite neat. All right, let me ask you a question. Okay. You've done C++ a ton. You still do it every now and then, right? I do it every day
Starting point is 00:14:25 yeah right on python have pointers somewhere i guess it's got to does it have value types like non-pointers can i have a thing that doesn't behave like a pointer i think of it more like references yeah all of python seems like a reference i want to cover an article passed by reference in python background best practices from the real python crew and also i just apparently failed this job interview so by marius mogiarosi hopefully got that somewhat close so marius wrote this article over there on real python which is pretty interesting and it sort of compares languages that have explicit you can explicitly work with things as references or pointers or you can work with them as local value types and then sort of compare that like there are certain types of problems you might solve or
Starting point is 00:15:16 address or algorithms over there that don't necessarily make a lot of sense in python so how would you simulate some of those behaviors so python's interesting because in the guts like everything is a pointer even the number four if you ask like the number four in c if i said four how many bytes would you think that would take it depends on in c yeah it's the machine type so it's right so probably four or eight something like that right how many bytes yeah yeah yeah exactly and when you create one it would be associated with the stack unless you did some funky stuff to like allocate it and like you do it like an amper to get the address but by default it's like comes on the stack and you pass around it makes a copy of it in python the number four is a pointer it's a c it's a pi long object out in the heap and it takes like 28 bytes like the
Starting point is 00:16:09 number four takes 28 bytes which is pretty interesting but so everything like even basic numbers that seem like they just might be values are like in the guts these sort of reference types but the function passing behavior is they say it's something called pass by assignment, which I'll go with that. So when I pass in, like if I create a variable, say x equals four, and then I pass the x to a function and that function changes the value of x, it's changed for the function, but not for the global thing that had it before, right? Yes. Well, in C or C++ or C Sharp, like all the examples here, actually, C Sharp, you can say, no, no, no, pass it so that if the function changes the variable, the one where it came from also changes, right? Right.
Starting point is 00:16:53 I can pass the, I guess in C, that would be the pointer to the pointer. You would make a change to the pointer. In C Sharp, you'd say ref or out or something like that, and it would make a change on the other side so how do we do that in python and like what are some of the interesting things that you might do said well python doesn't have value type so it doesn't one of the problems with the value type world is like maybe if i created a class let's say a class in c++ and i create it on the the stack and i pass it it, it can make a copy of that.
Starting point is 00:17:26 Is that right? Anyway, it's definitely, if you don't use the new keyword, like these pass-by values are making copies of the data that's passed around. That can make things slow. Python, everything at some level being a pointer doesn't have that problem. So that doesn't apply. But how do you implement these algorithms? So it says, well, if you want to actually have the
Starting point is 00:17:46 function make a change you can do a couple of interesting things like you could suppose i want to pass in a variable maybe have that variable change but also get like a true false back like it worked or it didn't work or something along those lines so they said look you can use tuple unpacking to return multiple values the return value and then the modified value which is one another thing is you could pass in a mutable data type like i create an object and change a field on the object right so that would have this or list or yeah anything that is mutable basically or another interesting one would be returning optional value types so if i had like
Starting point is 00:18:26 a function that was say like they would say okay we're going to try to parse a string into an integer and i either want to tell you here's the number the integer you got or it didn't work forget that you might throw an exception but suppose for some reason this example you don't want to throw an exception right what do you do well you could return the value and whether or not it worked as a tuple and that's one thing like in c sharp the example they say is as a tripars takes the string and an out integer which is like a one-way ref type of thing so how do we do that in python well you could do just this multi-value multi-return value tuple unpacking like it worked
Starting point is 00:19:06 and here's the value or it didn't work and there's no value which is i don't really love that one one that kind of is interesting is like you could use optional types so you could return an integer and if it's not parsable you return none and then use the walrus operator to say like value colon equals try to parse it if that's not none then you're good to go that one's kind of okay with me how do you feel about this brian i feel like people are trying to force non-python programming styles into python yeah but it's interesting it was reading through it just made me think about think back to my c++ days and all these patterns of passing variables and changes and you know passing by reference pass copy copying
Starting point is 00:19:46 values and all that stuff it's probably worth reading i think even if you don't necessarily need to do it that much yeah i actually like to be more explicit and have um either do functional programming where you're i like the functional model where you you pass in data and you return the return the modified yeah exactly the other approach other approach that I like is to know, I mean, you have a shared data that you're pointing to, that you pass a modifiable data, like a list or something, and say, hey, this function,
Starting point is 00:20:18 and it needs to be obvious, like fill out the data. It needs to be obvious that the thing you're calling is going to change that, or use a database to reference changeable stuff but yeah a lot can be done with data structures anyway i thought it was interesting to compare these other styles of programming to how you might compare get them done in python and i think i'll go for the optional if i had to pick one of these to write i think i would go for the optional tripars that returns none if it doesn't work. Assuming that you don't want exceptions, right?
Starting point is 00:20:48 Right. And that's also the default. If you've got the return of a value in some nested data or logic, and you don't return anything otherwise, you're going to return none. Yeah. When I first started learning Python, that's something that was strange to me is that every function returns a value even if the word return doesn't appear in the function it just happens to be none like the fall through case sort of in there is return none if nothing i forgot that that's not obvious yeah yeah yeah but that's
Starting point is 00:21:22 that takes some uh getting used to because all the other languages, you say it returns one of these things. If you want to return something, you say return none at the end or something. Anyway, a lot of interesting ways to think about passing variables and some of the patterns there. Yeah, my head hurts. So if we're going to write some of these down,
Starting point is 00:21:38 maybe you should just put them in GitHub and store them, huh? I apologize again. I think somebody on Twitter sent us this, but I couldn't find the reference this morning. This is a really cool thing. The author is Wei Wang, I think. Goes by Only Wei on GitHub. And it's a tool for visualizing Git concepts.
Starting point is 00:21:57 And I absolutely love this. He actually references a Git basics page, which is, I forget where that's at, but it's a good explanation but it's a you know it's a visual not really it's like a static thing that you read about all the different ways and all the repos and where they are and everything and that's you kind of have to read that once even though if it doesn't make sense read something about how git goes together but this visualizing tool is super cool the one he he's put together, it says visualizing Git concepts in D3,
Starting point is 00:22:28 and it just nails the things home. It's really cool. It's got all these different concepts like commit, branch, checkout, checkout with a B, reset, revert, merge, rebase, tag, fetch, pull, push. And you just start out with a diagram of what your repo looks like with branches and everything in the dots and then on the left side you can type commands and you you don't have any code you're changing you're just you're just typing these commands to see what it does to the the repository tree and it'll like add nodes and add tags and things move around and it's like light bulbs go off in
Starting point is 00:23:07 your head where you're like oh that's what's happening when i do a checkout all i'm doing is looking at a different branch and that's it yeah it's pretty cool so yeah it's this cool interactive command thing like you said there what if i type this and this what if i do like two commits and then a branch and then a commit and then check out the other branch and do a commit? How does that whole thing look? Yeah, it's pretty nice. And it tells you like there's a little instructions around each little lesson to describe what's going on and then suggest things to try. But the interactive thing, you can do whatever you want within it.
Starting point is 00:23:40 You can try things out. And it doesn't it doesn't handle all of the things. Like, for instance, I tried to get checkout with a dash for the last branch. That's not implemented. It's not there. But it's pretty cool. You know, another thing that's nice about it, I mean, the fact that it doesn't support everything isn't necessarily ideal.
Starting point is 00:24:01 But one thing that is pretty cool is you don't have to be totally accurate there to make it work right you can just do a get commit and you don't just like add stuff and fake stage things and then like commit them you just type like get commit get commit get branch and it kind of just shows like there's sort of a shorthand like if you kind of got the sense of it it'll do the stuff to let you you You don't have to know your Git perfectly. Yeah, and the commands that involve... Because you kind of want to play with this stuff to try to get your head around it, but you don't really want to muck up your own repo or your code base.
Starting point is 00:24:35 The ones that involve the origin, remote repository, like fetch, pull, and push, those are great to be... You visualize both of them at the same time. And there's two pictures going on. And this is definitely something, a desktop sort of thing. I don't think that, I think it would be tricky to do this
Starting point is 00:24:52 on an iPhone or something like that. Yeah, without a keyboard, yeah, for sure. I'm definitely going to bring this to my team and say, hey, everybody, check this out. Yeah, you should do things like, I want you to build a picture that looks like this what git commands and what order the commands are necessary to result in this structure right i think that would be a cool way to do it man okay so so the second part of the interview i
Starting point is 00:25:17 will fail at also man you're tough i'm glad i'm not interviewing with you oh my gosh yeah no i think that would be cool though because you're like all right well because i think conceptually we also have this idea of like i this is the picture i want but what are the commands that like take those steps right yeah i'm still getting over the uh quick the integer four uh how many bytes how many bytes in python Four or eight or something. Yeah, exactly. 28 is not what you would expect, but in Python it's 28.
Starting point is 00:25:50 Yeah. Okay. And if you want to test, import sys, get object size, pass the number four. All right. But here's the next question, Brian.
Starting point is 00:25:58 If I have a hundred fours in a Python program, how many bytes does it take? 28. Yeah, exactly. Plus the pointers that point at them. but yeah, 28. That's pretty cool. So 128, I don't know. Eight times
Starting point is 00:26:12 828? I don't know. How big are the pointers? I think they're 64-bit, so they've got to be eight. I don't know. We've gone down a hole, though. We don't need to. What I would rather talk about is MicroPython. Yeah, so this is round out the extras oh yeah we're in the extras now a micro bit announced that it's going to come out with
Starting point is 00:26:30 a new version in november it's got a whole bunch of videos showing the the cool stuff they're shooting at the same price point they had before which i have no idea what it was but reasonable but micro bit now has a speaker and a microphone so you can play sounds and and do things like, uh, I don't know, record your voice or something. I don't know what you want to do,
Starting point is 00:26:49 but, but that's neat. Nice. Mike. Yeah, it does do a micro Python. I think that, I think that do something else also,
Starting point is 00:26:56 but why would you do something else? Use micro Python. Yeah, exactly. Yeah. I'm looking for the price. Um, all right.
Starting point is 00:27:03 Too much math. I think it's $21. Uh, but that's Australian, so I don't know. Something like that. It's not a lot. Australian? Well, the first thing I pulled up was $2,119 Australian, but that's for 100 packs, so. Okay.
Starting point is 00:27:19 All right, cool. Now, that's really neat that the sound is coming in and you can interact with it. I think there'll be a lot of neat stuff you can do there. That's a really nice, I mean, so far a lot of these little devices, like how do you interact with it? Well, you can kind of shake it
Starting point is 00:27:31 or you can touch this button or it like has an LED and sound is a whole nother level, right? You could do speech recognition. You could play like, I think it's really neat. Yeah, it looks like they've got some plans to extend what this can do in the future too. So this is pretty cool. Yeah, absolutely.
Starting point is 00:27:45 I'm a fan of the Circuit Playground Express. That's a really fun thing to play with, but this is neat also. Yeah, for sure. All right, I got two quick things to share with people. One really fast one. Yesterday, so eight days ago in real time, I was on the 425 show, which is a Microsoft identity twitch stream spent three hours converting a flask web app to use federated identity and like remote login and all sorts of cool stuff like that and like
Starting point is 00:28:17 just to step away from also having like social logins and whatnot using all those libraries so people are interested in that i'll link to the the whole show and i just want to comment it's kind of it's a very different way of presenting like i'm used to polished presentations like what are we going to do in this half hour let's get it all down really clear here's the demo i'm going to write i've already like gone through it once so i know it's going to work and this is like hey we have this idea let's just work on it until we get it done and just kind of like take input from the audience from the people watching live and yeah for people who've done presentations and haven't done this style it's it's an interesting shift it's a cool way to like sort of present programming to people i think so would you do it again did it was it fun yeah it
Starting point is 00:29:00 was fun it was a little stressful because i haven't done a lot with like you know like oauth identity type stuff so i'm like i have no idea if we're gonna be successful like making this work at all but it was fun and you know spoiler alert it worked in the end is the 425 a joke on like you know five minutes after 420 or yeah that's um i have no idea no idea why okay there's an about let me see if it says what it says in the about i have no idea it doesn't say okay but anyway it was uh it was fun so people can check out that video and then also i've started using something interesting that people may find interesting so one of the things that bugs me is so much of our life is on the web brian as you know and how many cookies do you think your browser has in it? If you would like to sum them up across all the sites, like an untold number is like a hundred thousand, 200,
Starting point is 00:29:51 like some insane number. If it had been, you know, the same browser for years and you've used it all day, like who knows? Right. So I had a couple of thoughts. I decided, well, I want to just restart all that from scratch so i erased every bit of history from my browser and fired it back up i'm like okay now i gotta log into all these things again which is fine but then also realize like do i want like say if i go to some random site you and maybe it has some cross-site vulnerability or whatever do i want that site potentially be able to say to get to my github things or my bank or whatever if i'm logged in so i started using this thing called firefox containers that let you basically create like isolated independent browsers
Starting point is 00:30:36 for like categories of sites so like all like github and all the and bitbucket and all those things are in their own container. So only cookies they ever see in login sessions and whatnot are between, say, GitHub and Bitbucket, like those. And all the other browsing, none of them know anything about that I've ever visited GitHub, for example. Oh, cool. So anyway, if that sounds interesting, I'll link to a little short video. Is there a limit? I mean, because you could possibly just do a container for each site that you go to you could it gets a little bit annoying because if you click on like if you're in like google drive and you click on a link and it takes you
Starting point is 00:31:15 somewhere and you did that like over over grouping it like you'd have to log in every time because it wouldn't know there's a little bit of juggling. So too many, it gets annoying. But yeah, anyway, it's kind of a cool idea to keep all those things separated. People definitely should put Facebook in there. Oh yeah, I have one. Specifically, the containers are like banking, shopping, code, cloud drives.
Starting point is 00:31:40 And I have one called Shund. And Shund is where Facebook is. Yeah, so for example, that's a great example. So like you go to all these sites and they have like Facebook pixels and all this tracking stuff, like because I put Facebook over there and didn't log into it anywhere else, then it will never, those things will never trigger for me in the sense of like being tied to my account. Right. And that makes me happy. I've got like one relative that's that the only way to get ahold of them is through facebook messenger and so i have to have facebook just for that yeah so you gotta get one of these and like you kind of sort of don't have it
Starting point is 00:32:14 awesome all right well that was funny but not nearly as funny as what we got coming up here okay all right you want to do the first one i'll do the next one and then you've got to do the last one because I don't know where we're going with it. Okay. So I'm doing the first one? Yeah. Okay. Where do developers drink? I don't know.
Starting point is 00:32:31 Where do they drink? At the foo bar. At the foo bar. I love it. Yeah. All right. This one, you got to do the last line for me. Okay.
Starting point is 00:32:38 Because this is a knock-knock joke where normally it's like, knock-knock, who's there? Cow. Which cow? Interrupting cow. That kind of thing, right? Yeah. All right. Knock-knock. Async function. Who's there? Cow. Which cow? Interrupting cow. That kind of thing, right? Yeah. All right. Knock, knock.
Starting point is 00:32:46 Async function. Who's there? Perfect. All right. So those are the two jokes. What's this last one? Oh, also, if anybody tells us that we've already done this async knock, knock joke before, we haven't.
Starting point is 00:32:59 This is the first time we just somehow asynced. That's right. Exactly. Yeah. It's a race condition it's not a not a problem fine yeah no i just something funny happened to me on twitter the other day somebody contacted me and said um hey brian what testing module would you recommend i'm aware that there's unit test and pi test but are there better options and you can you guess which one I recommended?
Starting point is 00:33:26 Well, you don't like to install stuff, so you definitely said Unitas. That's right, yeah. That's funny. Awesome. Cool, cool. I thought it was a joke at first. I really thought they were joking. They were pulling your leg. They're like, let's see what you'll say. Come on, of course you'll say PyTest. Yeah, but apparently he knew
Starting point is 00:33:43 of me somehow without knowing that I wrote the book. Yeah, exactly. Cool. Cool, well, thank you as always. Thank you. Talk to you next time. Yeah, see you next time. Thank you for listening to Python Bytes.
Starting point is 00:33:55 Follow the show on Twitter via at Python Bytes. That's Python Bytes as in B-Y-T-E-S. And get the full show notes at PythonBytes.fm. If you have a news item you want featured, just visit pythonbytes.fm and send it our way. We're always on the lookout for sharing something cool. On behalf of myself and Brian Ocken, 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.