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 Okken.
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 tell me.
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 across like every entry is like 20.
It's like a list with like 20 length, 20 lists in it. 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.
You know, a lot of array processing 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?
So, Simon Thor sent us a message and said, you all should talk about awkward arrays.
So awkward arrays, this is a, 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 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, you know, like at 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++ at where the, in the business end of the
library. So it's super fast. Nice.
Yeah. Pretty cool. And what do you think about the logo?
The logo is actually great. It's awkward array, but the second array is below awkward and the A is
capitalized. So it sort of runs into the K and the W and the F to squish out of the way. It's very
clever.
Yeah. 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, but if you were
to go there, like right on the page, it says, here's the Python quickstart. Oh, and here's the C++
quickstart. 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 sciencey things and you have a big C++ C component aspect of it, you could use the
C side of it directly there. Nice. Yeah. So that's actually something 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, it's,
I have a lot of cases for this. 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, 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? It'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.
You want to check it out. Yeah. You got any surprises for us? Yeah. The surprises came from Ned
Batchelder. So, Ned surprised us with, some surprising order dict, ordered dict surprises.
So I think we've covered this, but in Python three, six dictionaries changed a little bit. So normal
dictionary, just, if you just say dict or just declare one, they retain their insertion order.
If you list them out again, or just, you know, say, you know, if you have X equals some dictionary
and print X on the, the REPL, it'll just print it in the same order it arrived in.
Right. And if you do like four K comma V in, you know, dictionary dot 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 and then you save it
again, right? Like that could just randomly be changing before. Whereas you'll be getting like,
yeah. 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 dot ordered dict that is, around it's still around and there's a few reasons
for it. And then one of them is just because it's a class that some other stuff derives from and it
would break backwards compatibility to, to remove it. So I'm glad it's still there, but Ned brings up a
couple of surprising things around it. The first actually wasn't that
surprising to me. What the, they're ordered, but you can't get access them by order. You can't say,
give me the first one by like saying like brackets zero or something. Does it surprise you? It doesn't
really surprise me.
Not really. I mean, I would just do, maybe just get the, 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 like index like bracket zero
Right. That's okay. The thing that actually I didn't really think about before was that, Ned brings up is that 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 have, they've, they've, they're created in the different order. They're still going to be equal. So two dictionaries are equal if they have equal contents.
It would super bug me. Like if I have a equals one, B equals two, or B equals two, A equals one. Like if the dictionary contents are the same, but the order changes and you're, they, 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 dict to make sure they're in the same order.
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, I wouldn't have known that. That's pretty neat.
Speaking of knowing stuff, you and I work on a few things. We've got some Patreon stuff going on. A lot of ways people can support us. I'll 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 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'd 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 Jupyter 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 NB, NB QA.
QA. 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.
I have to just know the order, the type, the name, everything.
Now, before someone mails in, I know I can type thing dot 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 dot should just I should be able to just flow and not have to like, OK, type.
And then, OK, 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 or more.
It rolls right off the tongue.
Language Server Protocol Integration for JupyterLab is its official name, but it's super cool.
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, 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 a 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 looks like code that's good, except for it won't run.
Whereas here, it'll put little squigglies under it and say, there's something wrong with this.
Or there's a warning here.
You're doing something wrong.
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, you've 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, ta-da, auto-completion.
If I type the character dot, it will know that I want auto-complete so I don't have to keep typing stuff.
That's pretty cool.
And then on top of that, it has rename refactorings.
So you can rename stuff across your cells and things like that.
Oh, that's great.
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 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.
Yeah.
But I mean the name Jupyter.
Jupyter.
Jupyter dash.
Jupyter lab dash LSP.
Yes.
Indeed.
Right.
All right.
What's this next one you got?
Well, speaking of Jupyter, I guess it's a little related.
This is a project that is implemented as a Jupyter book.
I'm not sure if we covered Jupyter 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.
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 Jupyter book.
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.
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 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 want to highlight is there's a basics of source separation section.
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.
Oh, 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.
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 GitHub.
So that's pretty sweet.
I do have a complaint, though.
Okay.
This is a big deal.
So there's a section in here on the basics of 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 like signals all the time.
And if you want to get into the math, the math is here.
So this is, this actually would be a great actual textbook for a university course.
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++ ton.
You still do it every now and then, right?
I do it every day.
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 and Best Practices from
the Real Python crew.
And also, I just apparently failed this job interview.
By Marius Mogiarosi.
Hopefully, I 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 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 the, in C?
Yeah.
It's the machine type.
Right.
So, probably four or eight, something like that, right?
How many bytes?
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 in like an amper to get the address.
But by default, it's like, it comes on the stack and you pass it around and 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 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#, like all the examples here, actually C#, 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?
I can pass the, I guess in C, that would be the pointer to the pointer, and you would
make a change to the pointer.
In C#, you would 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?
I 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 stack and I pass it, it's, I think it can make a copy of that, 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 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 list, or yeah, anything that is mutable, basically.
Right.
Or another interesting one would be returning optional value types.
So, if I had like a function that would 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#, the example they say is as a tripars takes a 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 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.
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, copy, copying
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 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 approaches to, that I like is to know, I mean, you have a shared data that
you're pointing to, that they're, you know, you're past a modifiable data, like a list
or something and say, hey, this function, and it needs to be obvious, like fill out the
data, you know, it needs to be obvious that the thing you're calling is going to change
that or use a database to reference changeable stuff.
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 try pars that
returns none.
If, you know, if it doesn't work.
Assuming that you don't want exceptions, right?
Right.
And I mean, that's also like the default.
If you've got like the return of a value in, in some nested data or logic and you don't
return anything, otherwise you're going to return none.
So.
Yeah.
You know, 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 happens.
I kind of forgot that that's not obvious.
Yeah.
But that's, that takes some 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.
Yeah.
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, some of these down, maybe you should just put them in and
get up 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.
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's, he's put together, it says visualizing Git concepts in D3.
And it just nails the things home.
It's really cool.
It's got these, 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, like 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 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 it 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 like describe what's
going on and then suggest things to try.
But the interactive thing, you can do whatever you want within it.
You can, 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.
So, but, 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.
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 don't have to know
your get perfectly.
Yeah.
And the commands that involve, cause you kind of want to play with this stuff to try to get
it, get your head around it.
But you don't really want to muck up your own repo or your code base.
The ones that involve like a, the origin remote repository, like fetch, pull and push.
Those are great to be, you visualize both of them at the same time.
And if there's two pictures going on and this is definitely something, a desktop sort of thing.
I don't think that it would, I think it would be tricky to do this on an iPhone or something
like that.
But yeah.
Yeah.
Without a keyboard.
Yeah.
For sure.
I'm going to 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 get commands and what order of the commands are necessary to result in this structure.
Right.
I think that would be a cool way to do it.
Oh man.
Okay.
So, so the second part of the interview, I 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.
Cause you're like, all right, well, cause 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, yeah.
Quick, the integer four.
How many bytes?
How many bytes in Python?
Four or eight or something.
28.
Yeah, exactly.
28 is not what you would expect, but in Python it's 28.
Yeah.
Okay.
And if you want to test, import sys, get object size, pass the number four.
All right.
But if here's the, here's the next question, Brian, 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, 828.
I don't know.
How big are the pointers?
I think they're 64 bits.
So they gotta 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 a new version in November.
It's got a whole bunch of videos showing 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, I don't know, record your voice or something.
I don't know what you want to do, but, but that's neat.
Nice.
Mike.
Yeah.
It does do a MicroPython.
I think that, I think that do something else also, but why would you do something else?
Use MicroPython.
Yeah, exactly.
Yeah.
I'm looking for the price.
Um, all right.
Too much math.
I think it's $21, 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 Australia, but that's for a hundred packs.
So.
Okay.
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.
I, 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 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 it was pretty cool.
Yeah.
Absolutely.
I'm a fan of the circuit playground express.
That's 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 four 25 show, which is a Microsoft identity,
which 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 just to step away from also having like social logins and whatnot using all those
libraries.
So if people are interested in that, I'll link to 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 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 going to 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, 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, 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, right?
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.
No.
Like an untold number, right?
Like 100,000, 200,000, 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?
Yeah.
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've got to 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 and maybe it
has some cross site vulnerability or whatever, do I want that site potentially to 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 for like categories of sites.
So like, oh, like GitHub and all the, and Bitbucket and all those things are in their
own like 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 people are, if that sounds interesting, I'll link to a little, short video.
Is there a limit?
I mean, cause 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 somewhere and you did that like over, over
grouping it, like you'd have to log in every time cause it wouldn't know it.
There's a little bit of a juggling.
So too many is, it gets annoying, but yeah.
Anyway, it's kind of a cool idea to like keep all those things separated.
People definitely should put Facebook in there cause.
Oh yeah.
I have, I have one specifically the container, like the containers are like banking, shopping,
code, cloud drives.
And I have one called shunned and shunned 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.
Yeah.
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 got to get one of these and like you kind of sort of don't have it.
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.
Cause I don't know where we're going with it.
Okay.
So I'm doing the first one.
Yeah.
Okay.
Where did developers drink?
I don't know.
Where do they drink?
At the food bar.
I had that food bar.
I love it.
Yeah.
All right.
This one, you got to do the last line for me.
Okay.
Cause it's a knock, knock joke where normally it's like knock, knock.
Who's there?
How?
Which cow?
Interrupting cow.
That kind of thing.
Right.
Yeah.
All right.
Knock, knock.
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.
This is the first time we just, they somehow,
asynced.
That's right.
Exactly.
Yeah.
It's just, 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, Hey Brian, what testing module would you recommend?
I'm aware that there's unit test and pitest, but are there better options?
Can you, can you guess which one I recommended?
Well, you don't like to install stuff.
So you definitely said unit tests.
Yeah.
That's right.
Yeah.
That's funny.
Awesome.
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 pitest.
Yeah.
But apparently he knew of me somehow without knowing that I wrote the book.
So yeah, exactly.
Yeah.
Cool.
Well, thank you as always.
Thank you.
Yep.
Bye.
Next time.
Yeah.
See you next time.
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 Python bytes.
Dot.
F M.
If you have a news item you want featured, just visit Python bytes.
Dot.
F M and send it our way.
We're always on the lookout for sharing something cool.
On behalf of myself and Brian Okken, this is Michael Kennedy.
Thank you for listening and sharing this podcast with your friends and colleagues.