Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 273, recorded March 1st, 2022.
And I'm Brian Okken.
I'm Michael Kennedy.
Well, welcome, Michael. It's good to have us here.
It's great to see you as always.
It feels like spring is almost here. It's March. I can't believe it.
So pretty awesome.
Yeah.
Fun to be talking Python with you.
Yeah. So should we kick it off with your first item?
Let's do it. I'm a big fan of science, math and all those things.
And I came across this article because I was reading about science, not because I was reading about Python.
But then I thought, oh, there has to be a Python story here.
Let's get into it and see if I can track it down.
And wow, is it not easy to find.
So here's the deal.
I saw an article over on sciencealert.com called Physics Breakthrough as AI Successfully Controls Plasma in a Nuclear Fusion Experiment.
That's so cool.
Let me, that's amazing, right?
So let me put a few things together here.
Nuclear fusion, not fission.
That's the kind of nuclear we want.
That is harnessing the sun with no negative effects to like turn hydrogen into helium and so on.
Right?
If we could harness that, that's like free, super easy energy forever.
It's incredible, right?
So people have been working on this for a long time.
The way that I understand, which is probably pretty piecemeal that it works is you put some kind of thing, some kind of material like hydrogen or something in the middle, and then you blast it with tons of energy.
But then it creates this plasma.
And you've got to control with lasers and magnets on how you basically keep the pressure high enough in addition to just the heat to actually make the fusion work.
Right?
So there's been some success like, hey, we got fusion to work for a while.
It just took more energy than it put out.
So, you know, it's not a super great power plant, but it did do the science thing, right?
Yeah.
So here's the deal.
This article says they've used artificial intelligence to teach it how to make instantaneous or near instantaneous adjustments to the magnetic field and the lasers in order to actually get better results with fusion, right?
So take it farther along.
And it says, in a joint effort, the Swiss Plasma Center and artificial intelligence research company DeepMind, they used deep reinforcement learning to study the nuances of plasma behavior and control inside a fusion tokamak.
That's the donut-shaped thing where the reaction happens.
And they're able to make a bunch of small adjustments really quickly in order to get better results.
And it's pretty wild that they did that with AI, isn't it?
Yeah.
There's definitely Python in there somewhere.
You just know it.
Exactly.
So I'm like, all right, where is this?
So I went through and they talk about the findings being in nature, some of the articles that they're referencing.
So there's some like deep, as in not super engaging sort of scientific articles, like the traditional academic style of writing that you've got to dive into and then like follow a bunch of links.
But eventually in there, you will find that there is some cool science stuff going on.
And Python is at the heart of it.
So it's probably not worth going into too much of the details of how it's actually happening.
But it's the Python side of things.
But I just thought it was super cool that, look, here's one of the most exciting things happening in energy and for the climate and for all sorts of things.
And AI and Python are pushing it forward.
That's crazy.
And that's what we need for a Mr. Fusion so that we can make flying cars and time traveling cars too.
Exactly.
I mean, Marty McFly and Doc, they go and they throw their banana peel on the back of the DeLorean, right?
You've got to have one of these token mucks to make it roll.
You've got to have Python in the car.
Come on.
Obviously.
So, cool.
Obviously.
All right.
Well, take us back to something more concrete.
Well, okay.
So I'm pretty excited about this.
It's a minor thing, but maybe not too minor.
PEP 680 has been accepted.
Standards track for Python 311.
PEP 680 is TomlLib support.
So support for parsing Toml in the standard library.
We haven't had it yet.
That's awesome.
So we've got JSON.
We've got CSV.
Why not?
Right.
We've got XML.
Well, and one of the, and now that we've, PEP uses Toml for PyProject.Toml, but anyway,
so we kind of need, I think it'd be cool to have it in the standard library.
I think it's fine to have other outside supports.
So what they're doing is, and if people don't, there's some rationale here, but, you know,
just think it's easier than normal.
So Toml is, I like Toml for, because it's just, I don't know, it's an easy format to
read.
It's better than any and some other stuff.
And for people who don't know, it feels any like, like the .ini file style where you've
kind of got like section headers and then key value bits.
Yeah.
And it doesn't, and often it doesn't like, you can use, you can use black and write a PyProject.Toml
file without even really knowing anything about Toml.
So it's pretty straightforward, but we didn't have a way built into standard library to
just use it.
So that's, this is this PEP.
One of the things there, interesting bits about it is it's only reading.
So it's only adding support for reading Toml.
So there's a load and a load, load S.
So you can load a Toml file or you can load a string and that's it.
And it outputs a dictionary.
So, and that, that, that makes sense.
You're just getting a Toml object and getting, turning it into, to a dictionary so you can use
it.
But this is built on top of Toml.ly.
So Toml.ly is being used as a, as, as the, as the library to basically there's an open source
project called Toml.ly, which a lot of projects are using.
I think this is the one that pytest is using and quite a few projects are, have switched to this.
It's really fast.
It's nice, but it supports like writing as well.
But yeah, right.
And then code and dump S and all those things.
Yeah.
Right.
So, so, but that's, that's not the part that's going to get supported.
And I think that's, I think that's fine to just have reading built into, to, into.
Sure.
Some file formats like text and, and CSV and whatnot, like reading and writing is super common.
Right.
But these are way more likely to be used as configuration files that drive app startup
and like hide secrets.
You know, you put your secrets in there and don't put in Git or something like that, whatever.
Right.
Those are the kinds of UK use cases I would see.
And so in that case, reading, reading seems fine.
You could always add writing later.
You just can't take it away if you add it too soon.
Right.
But, but also like, I don't, I don't, and I'm sure there are reasons to, to need to write
it, but I don't, you know, it's, it's mostly people write it and computers read it
sort of thing.
Yeah, exactly.
Some kind of editor writes it and then you read it.
Yeah.
So.
Fantastic.
All right.
Well, cool.
Very nice to see that one coming along.
Alvaro out in the audience.
Hello there.
It says, Hummel just reached version 1.0, not so long ago.
So maybe that also has some kind of impact on the willingness, like, all right, the file
format is stable.
Now we can actually start to support it in the library.
That's true.
And, and we, we do support Python releases for a long time.
So that it probably needed to be V1 at least.
So.
Yeah.
And Sam also says there's a lot of stylistic choices for how you write Toml files.
Like we need a black for Toml, not, not to drive Tom, not to configure black, but something
that then goes against Toml files and, you know, makes them consistent.
Yeah.
Maybe.
Yeah.
But you could, yeah, you could, you could bake that in.
All right.
What have I got next here?
I've got sticking on the internals here.
I want to talk about thread locals in Python.
Okay.
So last time we had Calvin on and I spoke about this crazy async running thing that I had built
and boy, is it working well.
I, like I said, it is truly horrifying to think about what it's doing, but it actually works
perfectly.
So there it is.
But one of the challenges that it has is it, it doesn't like it if you call back into it
again.
And I talked about the nest asyncio project last time, which maybe we'll solve
it.
I tried those and it wasn't working, but it could have been like at a different iteration
before I finally realized like, no, I have to go all in on this threading, like isolate
all that execution into one place where we can control it.
So maybe it would work, but I just wanted to talk about thread locals in Python, which I
thought were pretty easy, and pretty interesting.
So I've got this stuff running over there.
And one thing that would be nice is each there's different threads calling into the system to
say, schedule some work for me.
Basically puts it on a queue.
The queue runs it on this like controlled loop, and then it sends back the result.
The problem is if, if one function calls that to put in work, and then as part of doing
that work, the function itself somewhere deep down, like wraps that around, it doesn't really
like the recursion aspect very much.
So what I thought is, well, how do I figure out, well, this thread has running work.
And if it calls again, you know, raise an exception and say, like, you need to adjust
the way you're calling this library.
It's not working right.
Instead of just like doing some weird thing.
So what I think I might do, and I'm not totally sure it will work perfectly, but the idea
is certainly useful for all sorts of things is to use a thread local variable.
Now, when I thought about thread local variables, I've used them in other languages, and I had
no idea how to do them in Python.
It turns out to be incredibly easy.
You just say, go to threading, the threading module, and you say local.
That becomes like a dynamic class that you can just start assigning values to.
So in the example that I'm linking to, it says you get a my data thing, which is a thread
local data blob, whatever.
So you could say like, my data dot x equals one, my data dot list equals whatever.
And then that will store that data, but it will store it on a per thread basis.
So each thread sees a different value.
So for example, what I could do is say thread, you know, at the beginning of the call, like
I have running work.
Yes.
At the end, you know, roll that back.
And if I ever call in to schedule some work and the thread local says, I'm doing, I have
active work running.
Well, there's that error case that I talked about and I don't have to do weird things
like put different IDs of threads into database into like a dictionary and then like check that
and then lock it.
Like all sorts.
I can just say this thread has like a running state for my little scenario.
What do you think?
I think that's great.
I think it's interesting.
Yeah, it is.
Right.
Yeah.
And it's right.
Not too hard.
Just create one of these little local things, interact with it in a thread and each thread
will have basically its own view into that data, which I think is pretty fantastic.
So.
Like a thread version namespace thing.
Yeah.
Yes, exactly.
Exactly.
It's a cool little isolation without doing like locks and all sorts of weird stuff that
can end up in deadlocks or slowdowns or other stuff.
So anyway, if you're got scenarios where you're doing threading and you're like, oh, it would
be really great if I could dedicate some data just to this particular run and not like a
global thing.
Check this out.
It's it's incredibly.
Nice.
Yeah.
Oh, let me pull up one more thing before we move on, Brian.
Okay.
How about Datadog?
Yes.
That's also something else that's extremely easy to use.
Yep.
Thank you, Datadog, for sponsoring this episode.
Datadog is a real time monitoring platform that unifies metrics, traces and logs into one
tightly integrated platform.
Datadog APM empowers developer teams to identify anomalies, resolve issues and improve application
performance.
Begin collecting stack traces, visualize them as flame graphs and organize them into profile
types such as CPU, IO and more.
Teams can search for specific profiles, correlate them with distributed traces and identify slow,
or underperforming code for analysis and optimization.
Plus, with Datadog's APM live search, you can perform searches across all across the full
stream of integrated traces generated by your application over the last 15 minutes.
That's cool.
Try Datadog APM free with a 14 day free trial and Datadog will send you a free t-shirt.
Visit pythonbytes.fm/Datadog or just click the link in your podcast player show notes to get
started.
Yes.
Thank you, Datadog.
I love all the visibility into what's going on.
I was just dealing with some crashes and other issues on something I was trying to roll out.
Some library was conflicting with some other library.
They were fighting.
And yeah, it's great to be able to just log in and see what's going on.
Now, before we move off to Threadlocals, quick audience question.
Sam out there says, it might be better to use context vars if you're also working with an invent loop.
As far as I know, context vars are the evolved version of Threadlocals that are aware of async too.
That's very interesting.
I haven't done anything with context vars, but the way I think asyncio works is even though there's a bunch of stuff running from different locations, there's one thread.
So Threadlocal is useless for that.
So that's why Sam is suggesting context vars.
The side that schedules the work has nothing to do with asyncio in my world.
So that's why I was thinking Threadlocal.
It's a good highlight to say if you're using async, you may need something different.
Absolutely.
Yeah.
So thanks, Sam, for that.
Yeah, so I'm not sure if we've really talked about it much, but I came across that article from Trey Hunter called, What is a Generator Function?
And like Python, especially, you know, the two to three switch, even like dictionary, the items keyword, you know, function to get all the dictionary elements out.
It doesn't return a list anymore.
It returns a generator.
And maybe it always did.
I don't know.
But there's a whole bunch of stuff that used to return lists that now return generators.
And it kind of, they work great.
You stick them in a for loop and you're off to the races.
But a lot of people are a little timid at first to try to write their own because it's a yield statement instead of a return.
And how do you do it?
And so this is a great article by Trey to just say, here's what's going on.
It's not that complicated.
Generally, you just have a, you often might have a for loop within your code.
And instead of returning all the items, you're going to try to write your own.
And it's pretty interesting.
It's interesting for people to read through it and understand what kind of what's going on behind the scenes.
So what happens is your function that has a yield in it, it will not return the item right away.
When somebody calls it, it returns a generator object.
And that generator object has things like next.
And mostly that's what we care about.
And next returns the next item that you've returned.
And then once you run out of items, it raises a stop iteration exception.
And that's how it works.
But generally, we just don't care about that stuff.
We just throw them in a for loop.
But it is interesting to learn some of the details around it.
Yeah, they do seem mysterious and tricky, but they're super powerful.
The more data that you have, the way better idea it is to not load it all into memory at once.
Yeah, and you can do some fun things like chunking.
You can, like if you're returning, like your caller, like let's say, and these are fun things to do with this.
So let's say you're reading from an API or from a file or from a device or something.
And it has, you read like a big chunk of things, like 20 of them or 256 or something like that.
A whole bunch of data at once.
But then your caller item, your caller really only wants one at a time.
Within your function, your generator function, you can do fancy stuff like read a whole bunch and then just meter those out.
And when then that's empty, you go and read some more and have intermittent reads.
And this will save time for, especially when you're not reading everything often.
Sometimes the caller will break and not utilize everything.
So that's definitely where, and they're very, they're a lot more efficient on memory too.
So if you're, like you said, if it's huge amounts of things, it might be either for memory reasons or for speed reasons.
These are great.
Yeah.
Even computational, like, so suppose you want a list of Pydantic objects back and you're like reading some massive CSV and picking each row and star star value in there somehow.
That's the actual creation of the Pydantic object.
If there was like a million of them, forget memory.
Like even just the computation is expensive.
So if you only want the first 20, like you can only pay the price of initializing the first 20.
So there's, there's all sorts of good reasons.
Yeah.
Okay.
I do want, I do want to just say one thing about generators that I wish there was like a slightly, maybe some kind of behavior could be added, which would be fantastic.
So generators can't be reused.
Yeah.
Right.
So if I get a result back from a function, I try to, and I want to ask you a question, like, were there any items resolved in here?
And then loop over them if there were like you, you kind of broke it, right?
You pulled the first one off and then the next thing you work with is like index one through N rather than zero through N, which is a problem.
So sometimes you need to turn them to a list.
It'd be cool if there was like a dot two list on a generator instead of having to call list on it, right?
Just like a way as an expression to kind of like, I'm calling this and it's sort of a data science flow.
I want all one expression and turn this generator into this other thing that I need to pass along.
Yeah.
It would be fun.
Yeah.
So a question out in the audience that maybe they, they returns that the dictionary items and keys return something different.
But Sam Morley says they, they return special generators, special kinds of generators.
So yeah.
Thanks Sam.
Cool.
Indeed.
All right.
Well, what have I got next?
I think I just closed it.
Now, would it really be an episode if we didn't talk about Will McGugan in some way or another?
So we got him on deck twice, but we're going to start with just something he recommended to us.
That's actually by Sam Colvin, who is the creator of Pedantic.
And I'm not sure if you're ready for this, Brian, but this is a little bit dirty.
It's called dirty equals.
And the idea is to abuse the Dunder EQ method, mostly around unit testing, to make test cases and assertions and other things you might want to test more declarative and less imperative.
So it all sounds like fun, but how about an example?
So it starts out with a trivial example.
It says, okay, from this library, you can import something called is positive.
So then you could assert one or like some number and whatever.
One equal equal is positive.
That's true.
That assert passes.
Negative two equal equal is positive fails.
Okay.
How does that strike you, Brian?
We're building.
These are building blocks.
This is like a Lego piece, not the whole X wing fighter.
But anyway, so that's the building block, right?
Like take something and instead of saying, yes, it's exactly equal, implement the Dunder equal method in the is positive class to like take the value, make sure it's a number, then check whether it's greater than zero.
Right.
That kind of thing.
I don't know if that includes zero, but anyway.
But then you can get more interesting things.
So you could go to a database and if you do a query against the database, you get, I think in the case that's up there, I think you get a tuple back.
It depends on what you set the row factory to be, I suppose.
But anyway, you get a tuple back of results.
It looks like maybe this is a dictionary.
Anyway, so then you can create a dictionary that has attributes that are like the result you want.
They can either be equal or they can be things like this is positive.
So in this case, we're doing a query against the database.
And then we're, looks like there's maybe needs to be like a first one.
Anyway, it says, all right, what we're going to do is we're going to do equal, equal that the ID, we'll create a dictionary, ID colon is positive int, username colon, Sam Colvin.
So that's an actual equality.
Like the username has to be Samuel here.
Okay.
Yeah.
And then the avatar is a string that matches a regular expression.
That's like a number slash PNG.
The settings has to be a JSON thing where inside the settings, it's got some JSON values that you might test for.
And that is created now, is now with some level of variation, like some level of precision that you're willing to work with.
Right.
Because obviously you run the database query and then you get the result, but it's like very near, nearly now.
Right.
It's like the almost equals and float type of stuff.
That's pretty cool.
Right.
Do I need to answer?
I mean, I could see the utility.
I'm sure your thoughts.
Yeah.
But the, I don't know.
It's the API is a little odd to me, but.
Okay.
Yeah.
I think it's, it's definitely an interesting idea.
It's definitely different.
you know, Pydantic is often about, I know it's not Pydantic, but it's by the creator.
Pydantic is often about, given some data that kind of matches, can it be made into that thing?
And I feel like this kind of testing is in the same vein as what you might get working with Pydantic and data.
Yeah.
Right.
Well, it's definitely, it's definitely terse and, and, and useful.
so, and, and I could totally get used to it.
If this is a, this is a pretty, pretty, condensed way to, to compare, to see if everything, matches this protocol.
Yeah.
So Sergey on the audience has like sort of the alternative perspective could be, you could just write multiple assert statements.
Instead of creating a dictionary that represents everything, you could say like, get the record back and assert that, you know, get the first value out and assert on it.
Then get the username out and assert and get the avatar and assert on it and so on.
And it's sort of an intermediate view, a story where you use the testing libraries, the testing classes, but sort of more explosive.
So, right.
And one of the reasons why a lot of people, there's, there's a couple of reasons why to not use more than one assert.
because if you were to have multiple asserts, the first one to fail stops the check.
It's possible that this will tell you everything that's, that's wrong.
Not just the first thing that's wrong.
Yes, exactly.
and, and then, you know, some people are just opposed to multiple asserts per test.
It's just for, you know, I don't know.
I mean, a similar thing.
So I have a, a plugin called py test check, which is, is just, it uses checks
instead of asserts so that you can have multiple checks per test, but, it does come up.
So this is interesting.
I'll definitely check it out and play with it.
Yeah.
Another benefit of being able to construct one of these like prototypical documents or, dictionaries
that then represents the declarative behavior or state that you're supposed to be testing
for is you could create one of these and then use it different locations.
Like, okay, when I insert a record and then I get it back out, it should be like this.
But also if I call the API and it gives me something back, it should also still pass the same test.
Like you could have a different parts of my app.
They all need to look like this.
Yeah.
As opposed to having a bunch of tests over and over that are effectively the same.
And Will is here who recommended this suggests, one of the benefits of dirty equals is that
py test will generate, generate useful diffs from it.
Yeah.
and definitely, reasons, py test being a reason to use something.
I'm on board then.
Yeah, sure.
Yeah.
Check it out.
If you do play with it, give us a report how you feel about it.
One more question from, Sam, said, Sam Morley, py test already has something
a bit like this with a prox, except for it's for floats, et cetera, except for a prox
is not, et cetera.
It's just for floats.
So you can only use approximate floats.
So yeah.
So we have like approximate now and stuff like that.
So I'll, I'll try it.
Especially, you know, if Will likes it, it's gotta be.
Good.
Exactly.
So awesome.
All right.
What's the final one you got for us here?
Okay.
This is more of a question than a, I'm not like saying this is awesome, but I ran across
this.
actually this, I went, I clicked on a listicle, Mike, I think there's a self
help group for that.
yeah.
well, we're definitely prone to clicking on the top listicles.
So my name is Brian and I clicked on a listicle.
so the listicle was a top 10 where we at, it was, 10 tools.
I wish I knew when I started working with Python and actually it's a good list.
I just knew about most of them as all.
So it's, it's, it's a little link to it anyway.
It's, it's got the sound of music.
It's got Jackie Chan.
It's got office space.
Come on.
This is a pretty solid listicle.
Then I got down to number seven and eight and I'm like, what are these things?
I've never heard of them.
So, committison and semantic release.
So, the idea.
So I tried to do a commit with this.
So committison is a thing that you can say, if you install it, you can either brew, install
it for your everything, or you can put it in a virtual environment.
So that's cool.
But it's, you, you, instead of just committing, you use this to commit and it asks you questions.
Right.
Instead of typing get space commit, you type CZ space commit.
Yeah.
And then instead of like, it, and it asks you a whole bunch of stuff.
It was this a bug fix.
Fix.
Was it a feature?
Did you, and then it follows on what, depending on what you answered, if you had a, if you had
a, a bug fix or a feature, is it a breaking feature?
Did you basically it's trying to, it's, it's doing a whole bunch of things.
But it's trying to do these, conventional, conventional commits.
And we've got a link to this too.
And, and then if you've got all this formatting, so it ends up formatting your commit message
to a consistent format so that when you're reading the history and stuff, you can do a whole
bunch of, it's easier, I guess.
and then, this tool also, this listicle also commented that you've got,
semantic release, which is a Python package that I haven't got through this much, but
it, it can take this, all this information from these and do some better control your semantic
release notes or release.
I don't know if it's the release notes or just the release version.
I haven't got that far into it, but.
Yeah.
The commit is an ass.
Is this a, like a change corresponding to semantic versions such that it should be a major change.
So it'll like, it looks like it'll increment the version and stuff like that as well.
Yeah.
but so, the, in the about, for commitment says command line utility to create
commits with your rules.
And apparently you can, you can specify some special rules, which is good.
display information about your commits, bump the version automatically and, generate
a change log.
That's cool.
I want, that might be helpful.
so my questions out to the audience and everybody listening, have you used something
like this?
Is it useful?
is there something different than this that you recommend?
And also what size of a project would this make sense for a small or medium project?
That's cool.
Yeah.
Let us know on Twitter or at the bottom of the YouTube live stream.
It's probably the best place.
Yep.
So.
Yeah.
Very cool.
Now, before you go on, I also have a question out to you.
You can be the proxy for the audience here.
Okay.
Notice at the bottom it says requirements three, six and above.
yeah.
And Python, that's not, I don't feel like that's very controversial as three, six is not even
supported anymore.
Right.
So this is like every possibly supported version of Python three, this works for.
Would, what would you think if I said the requirement is this is Python three, not Python
three, just, it requires Python three.
Knowing that like that means, or implying that that means supported shipping, real,
versions of Python, not Python three, one.
Right.
Cause obviously Python three, one is no longer supported, but neither is three, five even
like, could you say f-strings are just in Python three now without worrying about the version?
Or do you need to, you still need to say.
Three, six, three, six, three, seven.
Like, should this be updated?
It'd be three, seven.
You know what I mean?
Kind of have to.
You think so?
I, I don't know.
I, I know I, when I say, something is on three Python three, actually, I don't even
say that anymore.
So yeah.
What do you think?
Okay.
well, I used it in the sense like, yeah, you need Python three for this thinking,
well, any version that's supported these days and people are like, well, there's older versions
that don't support this thing.
Like, well, you know, obviously I'm not talking about the one that was not supported five years
ago.
Like at some point, Python three is the supported version of Python.
I don't know.
Oh, that's true.
Yeah.
Okay.
So that's a bit of a diversion there, but I went down that route.
Hold on.
It's like, I really don't know which way I should go, but I feel like there's, there's a case
to be made that just like, when you talk about Python three, you're not talking about old
unsupported versions.
You're everything that's like modern three, seven and above should be like an, an, an, an alias
for Python three.
I don't know.
When we were just saying Python three, what we meant was like three, one.
So I know we got to get used to that.
There's no Python two really to worry about.
All right.
Well, that will definitely bring us to our extras in a moment.
Yeah.
All right.
You want me to kick it off since I got my screen up?
Yeah, go ahead.
All right.
So we'll, like I said, he gets two appearances and also it's comments.
So thank you for that.
And this is like in the same vein of what I was just talking about.
Like what is this convention that we want to have?
Right.
So the Walrus operator came out in three eight and it was kind of an interesting big deal,
right?
There's a lot of debate around whether or not that should be in the language.
Honestly, I think it's a pretty minor thing that that's not a, not a huge deal, but the
idea is you can both test for a variable as well, or you can use the test or use the value
of the variable in the same place that you create it.
So instead of saying X equals get user or like you equals get user, if user is not none or
if user, you could just say, if you colon equals get user do the true thing.
Otherwise then it's, it's not set.
Right.
And so Will is suggesting that we pronounce the Walrus operator as you becomes the value.
So like X colon equals seven is like X becomes seven.
What do you think?
Are you behind this?
Okay.
So you'd be like when you're reading your code to yourself, I guess.
How do you say it?
Like if you say like the Lambda expression, like how do you like define like the variables
of the land?
Like there's, there's terms around there that make it a little bit hard to say without just
saying syntax.
Right.
So he's proposing like becomes is the saying, the verbal, the way we verbalize Walrus
operator.
I like it.
I'm going to give it a thumbs up.
It's interesting.
But what, how is that different from assignment though?
Do we, do you say, what do you say with assignment?
I don't say like X equals, I don't know.
Yeah.
Equals, the same become, becomes works.
all right.
Well, I'll put it out there.
People can think about it.
And there's a, there's a nice Twitter thread here with a, lots of comments.
so folks can jump in.
Or you just, walrus, just talk X walrus five.
oh yeah.
Well, what do walruses do?
I mean, is there like a cool action that would, is like particular to walruses?
Well, there probably is, but it's not, it doesn't apply to this.
It's not a very colloquial, is it?
is X.
Yeah.
And John, then John Sheehan out of the audience says, in my brain, I use assigned to, and he
must know what's coming because he's up next.
Hey John.
so the other thing I want to talk about is, did you know, I learned through John that
string starts with, we'll take a, an iterable, it says tuple, but I suspect it might even be
an iterable of sub strings.
And if any of them match, it will, it'll test out to be true.
So like ABCDEF, you say starts with a tuple AB or CD or EF.
Huh?
I've never used this.
I didn't know that that was, I would always just do that as like X starts with AB or X starts
with CD or X starts with EF.
No, you can apparently can do that all in one go.
What's the two for?
I have no idea.
I was just thinking that as well.
There's a two and I don't know where, what is four.
So yeah.
Yeah.
Anyway, that's a super quick one, but I thought, pretty interesting there.
That's all I got.
How about you?
I just have one thing that I, we don't need to put it up, but my extra is this book.
You have your physical 2.0 book in hand.
Yes.
I've got, I've, Oh yeah.
And for the people not, not watching, my, I've got a stack of, it's funny.
My, my, my daughter uses my Amazon account too.
So UPS said, Hey, there's a package arriving yesterday.
And I said, I didn't, and I didn't order anything.
So I said, I told my daughter, Hey, you probably have a package showing up.
She's like, I didn't order anything.
and then this box arrives with five copies of my book, which is great.
That's awesome.
Yeah.
Congratulations.
Thanks.
Very cool.
Yeah.
We abuse our Amazon account badly.
Like there's a lot of people that log into Amazon.
We end up getting stuff shipped wrong places.
Cause somebody shipped it to their house last time.
And then we just hit reorder again.
And they're like, why do you have our shampoo?
I don't know.
Yeah.
yeah.
So John adds that the, two is the starting position.
Oh, the starting position.
Yeah.
Right.
I figured it had something to do with that.
I wasn't sure how many characters to compare out, whatever.
Well, I also didn't know if the, that you could do that.
It's a good pass.
The starting position for starts with.
That's cool.
Yeah.
There's a lot going on here.
Almost starts with.
all yeah.
Nearly starts with.
Yeah.
What's the, what's the, what's the, what's the right way.
So I want to close this out with a, a joke as always, but there's the joke we talked about
a while ago, where, Sebastian Ramirez creator of FastAPI saw an ad hiring a FastAPI developer.
And he said, Oh, it looks like I can't apply for this job.
It requires four years of experience with FastAPI, but I can't possibly have that.
Cause I only created it two years ago.
Right.
Yeah.
So it's a little bit in that vein.
So here we have, somebody, tweeting and says, here's a conversation with the recruiter
and them.
It says, recruiter, do you have a CS background?
Yes, absolutely.
My CS background.
And this is the screenshot from the game counter strike, which is often referred to as just CS.
Yeah, of course I got a CS background.
Are you kidding me?
That's pretty good.
I love it.
Yeah.
yeah, that's a good one.
Well, just a question though.
If you, if you did FastAPI instead of eight hours a day, if you did it 16 hours a day for
two years, would that constitute?
You know, that probably, that probably is about the same amount of experience.
Yeah.
So what a slacker that Sebastian is.
Does he have to eat or something?
Does he have family?
What's going on?
Come on.
Well, always fun with, hanging out with you and talking Python.
So you bet.
And thanks to everybody on the, that listens to it on, on their podcast player or watches
us on YouTube.
Yeah, absolutely.