Python Bytes - #241 f-yes we want some f-string tricks!
Episode Date: July 7, 2021Topics covered in this episode: Autosync all branches of a fork Measuring memory usage in Python: it’s tricky! Python f-strings can do more than you thought. f'{val=}', f'{val!r}', f'{dt:%Y-%m-%d...}' 10 Tips and Tools You Can Adopt in 15 minutes or Less To Level Up Your Dev Productivity How to Start a Production-Ready Django Project Bunch Extras Joke See the full show notes for this episode on the website at pythonbytes.fm/241
Transcript
Discussion (0)
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 241, recorded July 7, 2021.
And I'm Brian Ocken.
Hey, I'm Michael Kennedy.
And I'm new here. I'm Jay.
Hi, Jay. Thanks for coming.
So tell us a little bit about who you are.
Yeah, so I'm Jay Miller.
I'm a developer advocate for Elastic, a company that does search
using Elasticsearch and many other fine tools that we create. And I spend a lot of time working on
podcasts, shooting video, helping other podcasters, which we'll talk about later, and yelling at
Michael and Brian as they're podcasting and they can't hear me. So yeah, that's what I do.
Oh, I would totally love to hear one of those.
Just like record yourself yelling at our podcast at the same time.
That'd be great.
So welcome.
Thanks.
You're kicking us off today, Michael.
So where are we starting?
Well, we're going to start with some automation here.
And I previously had covered that if you go over to GitHub,
I'm not logged in, I guess it's not going to work.
But if you go to GitHub and you forked a repo,
so for example, if you forked CPython,
if you forked FastAPI,
you know, whatever project it is you forked,
all of those things are under pretty active development.
And very quickly, your fork will get out of sync
with what's called the
upstream, the thing that it was forked from. And GitHub recently added this ability, which we
talked about to go to a repo and press a button. It says your fork is behind. Would you like to
catch it up? And you can click a button and boom, it'll catch it up. So well, that's neat. But
wouldn't it be nicer if you didn't have to do that? If it
just did that on its own, like sometimes you fork something and you're actively making a bunch of
changes to it and there might be merge conflicts and all sorts of stuff. But a lot of times I would
bet the majority of the time people say that's neat. I want to save that for myself just so I'm
sure I've got it and I can do whatever I want want no matter what happens to it, right? Maybe we depend on Flask
and who knows what could happen with Flask?
Probably nothing,
but let's just fork it just in case, right?
And you just want that to stay in sync.
So here is an article or walkthrough by Yash Walia.
Oh, it says three easy steps to auto-sync
your forked repo with Upstream,
the origin thing that it came from. Now, of course,
you could go to a command line and run a bunch of steps to do this. But what this does is it uses
GitHub actions. So you come down here and you can go to GitHub actions. And basically, when you're
choosing a GitHub action, there's like this marketplace or this catalog of prebuilt actions
that you can choose from as templates or whatever. And then it opens up a text file
that you basically type in the bits that you need changed.
So you go to the GitHub actions
and there's one called fork sync with upstream action
from the actions marketplace.
And you can see it says on the schedule
once every day at 7 a.m.
What we're gonna do is we're going
to run on ubuntu guessing docker image it's going to check out the your project and then it's going
to pull the upstream changes it's going to add the upstream origin going to line up the branches
do the checkout and then just merge that in and push it back. So pretty straightforward to do.
I ran this on some projects. And you know, one of the recent changes at GitHub and moves is to
get away from like master branch terminology. And now it's all called main. But I had some that
when I forked it previously, and it was master that became main, I had some challenges trying
to like, I think I just chose poor examples to try
to work from. So I didn't quite get this
working perfectly, but people with
more GitHub Action experience than I have,
I'm sure they can make it work. So this seems like a really cool
way to just say, yes, I want to fork something
and please just stay
up to date. This is definitely
neat for something where you're
actively working on it a lot. I think
if you're just trying to train something out and out and uh forking it for a little like play play yard thing
i don't i definitely wouldn't turn this on but like with a team where you're all working on the
same code you definitely want something like this so this is oh i hadn't really thought about it
from the team perspective right because a lot of the git flow with teams thing is fork it um make changes and do a pr i mean also sometimes people just create feature branches and
do a pr within the repo but if your mode is to create your own pr your own repo and then do the
prs back to the main repo i can see that this being really helpful yeah we use a a method in
git lab where it's on the we have to, the main repo has
to know where all the forks are, but it does a push every time there's an update to protected
branches. I see. That's cool. I was thinking about using something like this for some of the
projects that I do, where there are folks that will take data sets, and they're just stored as CSV files,
and they're sitting in repos. And I'm like, well, if I have access to this data, and I want to do,
you know, some project with Elon or another, you know, tool that I use, then I have to then go and
just manually download their CSV file and update it every time I'm about to present on that data
set. Whereas if I just say, hey, I can fork their code
and then build my project off of their repo and then set this up so that anytime they update
that one area, it's just always up to date for me. I don't have to think about it. I don't have
to go in and go, oh, hey, was there an update? It's just like constantly running in the background.
And I know you mentioned, Mike, at the beginning, like GitHub is working to make a lot of this easier. I mean, I feel like kind of their mission now that
they control like 90% of the Git surface out there on the internet is to just make lives easier for
the people that are using their products. So I think that, you know, stuff like this stuff,
like having just a simple notification that says, hey, this, you know, your upstream branches, you know, ahead of you.
Click here and we'll we'll get everything merged in.
And the less GitHub commands I have to try to put in to remember that I am going to mess up 100 percent of the time, the better.
Yeah. It's so close to having this built in. Right.
You've got the button that says right now sync this.
If it just had a checkbox or something and just keep doing that, if you, when you see these changes, you know, like
basically install this automatically for me, that'd be fantastic. Maybe when you fork it, right? I want
to fork it and I want it to stay up to date. I guess probably the hesitation is certain things.
It requires certain behaviors. For example, you shouldn't be making direct changes to the branch
that you're
thinking with because you might end up with merge conflicts. You have to work on a separate branch.
And I don't know, it probably gets complicated, but I would love to see this more automatic.
Yeah, it's cool.
Brad, I'm trying to remember what the next topic was. My memory is not that good. What do you,
you know, don't you?
Yeah, memory usage. So you actually have a talk about this, don't you, about memory?
I do. I've spoken about it before, memory usage. So you actually have a talk about this, don't you, about memory? I do.
I've spoken about it before, for sure.
Yeah.
But so this is a cool article by Itamar.
I think his name is Itamar.
Is that right?
Yeah.
Anyway, it's a nice, easy to follow discussion.
But there's a cool example he goes through where it it's kind of a neat one-liner to allocate three
gigs of memory i didn't you know it's kind of a neat thing with numpy um just allocating a a
a byte array um or uh three like a 1024 by 1024 by 1024 by three matrix so uh some clever math there you get three gigs um but it actually works and
then uh he goes through and uses um ps util to uh um to to read the memory and and figure out how
much is there so i had to i actually i paused at this point when i was reading the article to go
and find out what all this stuff does so So when allocating like a ones array,
you can NumPy as a way to just pre-allocate a bunch of ones,
which is neat.
And you give it a shape of what the vector shape is
that you want it in.
But then also this process stuff, it said RSS,
and I'm used to RSS being really simple syndication.
So no, RSS is, what is it resident set size which is essentially translates
to the to the resident memory which is essentially how much ram you're using so anyway how much ram
are you using and and we're using three gigs a little bit more um and then uh and then he does
something that i i was like surprised by goes out and just opens a couple browsers and windows and
then goes back and checks again and suddenly it's down it's like way down and i tried this
and i can't get it go to go really far down um and that's because uh your computer is uh
is managing memory and taking some stuff out of ram and putting it on disk uh and saving it till
later so there's this is kind of a neat. It's using the memory,
but it's not currently actively loaded as R.
As RAM, yeah.
Gotcha, okay.
So basically this is a little bit of a tutorial
on how memory works with your computer
and what the difference between allocated memory is
and peak allocated memory and resident memory.
And the allocated and peak allocated is like the max
that's allocated at the time.
And it's kind of too much to go into in this conversation,
but it's a really interesting discussion.
And he also talks about how to measure these
using what the PSU tell for one.
And then also for the peak allocated memory,
he used a profiler called fill.
So I thought I learned a lot in just a few minutes
reading this so yeah very nice yeah nmr is doing all sorts of cool stuff stuff with um memory
analysis and profilers and whatnot um there's a surprise in here of if if you fill it with ones
you actually get three gigs but if you do the same thing with zeros, you get like nothing. So Python and NumPy figure, it's just zeros.
We'll just remember that they're zeros.
And until you actually do something with it, we won't allocate it.
Oh, it's like a lazy allocation or something.
Yeah, I guess.
Yeah, interesting.
Yeah, so what I was going to say is another thing that's tricky is like this is using psutil.process.memory to analyze it is just what
how much memory is the process using which is not always the right way to think about how much
memory you're sort of demanding because the allocation in python you know you allocate in
blocks big blocks of memory and then the blocks are managed in our pools and then the pools are
managed in arenas and there's a lot of pre-allocation and then reuse, but you end up with over-allocation
and then eventually filling those up with things.
And so it gets pretty interesting about actually understanding precisely how much memory and
what's using it.
It's not quite as straightforward as just how much process memory is being used.
But that's still a decent proxy, right?
I just want to know how I can subscribe to that RSS feed.
I know.
I had the same thought when I saw it.
All right.
Jay, you got the next one.
What we got here?
All right.
So this originally came from a video that I saw trying to solve a problem that I had.
And I had to do some deep searching
to figure out whether or not we'd talked about it before,
if y'all had talked about it before.
But we all know F strings now.
We love F strings.
F strings are awesome.
F strings can do a lot.
Sometimes folks don't realize how much F strings can do.
Like, for instance, did you know
if you put an equal sign after a value,
it will actually give you the variable that you've provided equals and then whatever the
value is, which I think is awesome when it comes to logging and figuring out other information.
But one thing I did not know is that you could use F strings to format date time objects just
right in the F string. So you don't have to do, you know, like date time dot
string F time or string F format or all that stuff. You can just do
F string, the date time variable, and then the
F string format code that you would use to
format it normally. And that's over here in this.
You know, if I just scroll down, you can see here where in this example,
they use just daytime,
daytime now, and then now colon the format.
I saw that and my mind was blown because that means I now have to go back through
a bunch of code and remove all of the string format
like parsing and just throw it directly into the datetime field.
I'm kidding.
I'll also just throw out there,
sometimes you want to have that stuff separated
so that it can be used elsewhere
and you don't have to constantly rewrite it.
But we now have another way to format our datetimes.
But sadly, it still probably sucks with dealing with time zones
because datetimes are hard. They are hard. But sadly, it still probably sucks with dealing with time zones because.
Yeah.
Date times are hard.
They are hard.
I think it's totally non-obvious that you can have variable colon, some format string
and an F string, but it's really nice.
The one that I use the most is colon comma for digit grouping.
I'm like, here's, you know, 2 million such and such.
And I wanted to do two comma, you know, three digits, comma, three digits.
I knew that you could do something like that.
I didn't know that that was how you did it.
So thank you for adding that to my list of things you can do with F strings.
Yeah.
And I know one that you've spoken about, Brian, is to do like the variable equals,
which Jay alluded to, where it prints out the name of the variable equals the value of the
variable. Do you use that often? I use it all the time because I'm a kind of a printf debugger kind
of person. Yeah. Let's see some comments from the live stream. Magnus. Hey, Magnus. Fstring is cool.
I find selecting between repper and string and F string is really useful. It's very neat.
Dean, hey, Dean.
How can I keep the formatting as a variable?
Can you just assign it as a variable?
Can you use it in the F string?
Probably.
Maybe you've got to call str of the variable.
I don't know.
Oh, man.
Well, that's where you start getting the bang art, like the exclamation point R to like just force it to do a repper on whatever you provided.
Again, not saying that you should do it that way, but I mean, probably could.
Yeah, yeah, definitely. And Sam out there in live streams says, how have I never heard of these?
Yes, I know. It's amazing. Amazing, amazing. All right. I want to throw in a quick thing.
I want to add to that really quick.
F strings.
If you find yourself with a bunch of code
that has been around for years,
pre 3.6,
and you're like,
ah, it's got who knows how many variations
of formatting strings in it,
and you just want them all to be F strings,
you can use flint, F-L-Y-N-T.
Run that against the top level of your directory.
Boom, everything's F strings.
It looks great.
I did this on like 20,000 lines of Python code project.
It had one error.
I submitted it to them.
They fixed it.
And yeah, it was really neat.
That's cool.
Cool, cool indeed.
All right, what's the next one here?
I guess I got the next one, don't I, Brian?
Yeah. Cool. Well, this't I, Brian? Yeah.
Cool.
Well, this one, I went back a little bit,
back and forth on whether or not
I actually wanted to feature this
because it's a little bit recursive, I guess.
So I did a talk for Manning.
They had a developer productivity conference talk
or a conference.
Jay, were you part of that?
I was not part.
I am hearing about this for the first time
and I'm very upset. I feel like you should have been part of this.
I know.
How did you not bring me here with your podcast and all?
So the conference was interesting.
There were some really neat talks.
There were some other talks that I'm not really sure
abided by the theme of the conference.
They were just like, well, here's a random tech talk.
I was like, oh, okay.
Well, but that's not productivity.
Anyway, I tried to abide by the theme.
So I came up with a talk called 10 tips and tools you can adopt in 15 minutes or less to
level up your developer productivity. So really what I want to do is just give a quick shout out
to like the 10 tips and people can go, if they're really interested, they can seek around the video
and go find that or email me and I'll send you the slides. So one of them is to use a proper shell.
Like I find every now and then I run into people
and they're just running, you know,
whatever comes out of terminal in macOS,
or they're just using cmd.exe on Windows.
And I was like, how can you go day to day like that?
There's so much possibility there, right?
So, you know, consider things like,
oh, my ZShell or my Posh.
I just installed my Posh on the Windows terminal
with the new PowerShell on Windows,
and that thing is so much nicer than what you had before.
That's cool.
So get a proper terminal with some of those options.
If you're doing anything on the web, use secure.py,
which just adds all the OWASP secure headers
that you're supposed to do.
Like, don't allow your site to be embedded in an iframe
and cross-site scripting and stuff.
Automatically, it supports like 10 different Python web frameworks.
And if you're on some other technology,
there's things like inWebSec,
which does the same thing for ASP.NET,
or I'm sure you can Google another one.
Tip number three, pick a nice GUI for your Git work.
Sometimes it's fine to do stuff on the command shell
or on the CLI,
but it's really nice to have visual views
of like branching and whatnot.
So think of like SourceTree or even PyCharm in VS Code.
Sync your GitHub forks, just talking about that.
So keeping that going.
Use a proper log framework like Loguru or even Sentry.
Use Let's Encrypt.
Number seven, you can go and just get your site map
and request every URL at that destination in your site map.
And that's a way to just like make sure your site's not going to die.
So you could put that as an integration test.
Use PageSpeed Insights to make sure your SEO is good
and your site's responding well.
Use Homebrew or Chocolaty on Windows.
And then the very last one is set up Dependabot
or even some of the stuff that we talked about, Brian.
Start using pip compile with a.in file
and you can tell it to upgrade the requirements
whenever you run some CLI command
and it'll regenerate your requirements.txt
based on all the dependencies
and it gives you a really nice
organization like this sub dependency is here because of these three things you've installed
in your main requirements.in and so on. So there's 10 quick tips that people can go play with and
check out that short video if they're interested. I mean, I know 11 quick tips wouldn't have been,
you know, an amazing brand, but
I feel like virtual environments, like not brought up at all.
That was.
Yeah, that's true.
That's a good point.
Yeah.
I mean, you should have been in the conference.
I'm pretty sure.
Oh man.
Yeah.
Only I know about it.
Do some people not use virtual environments?
Dean also has an 11.
There may be 12 now.
Close that facebook tab
yeah i'm surprised at how many people don't use virtual environments still or even i i don't want
to say something like using like pipm or poetry or anything like that mostly just because i don't
have a lot of experience with them but um what is it virtual environment wrapperpper or even PyInv, just really great tools to make sure that
everyone's operating on the same Python version.
And that if you need to run Python 3.5 on one thing because your code isn't set up for
it yet, and then you want to run 3.9 on something else, having tools like that, once you learn
them, they're so phenomenal and just so easy to use.
I wonder if the overlap of the people that have a Facebook tab up are the same
people that don't use virtual environments.
Probably.
Probably. Notifications as well. Turn off notifications.
Like don't let Outlook or other things like that, like send you,
like don't let your email send you messages. They're like pot toast, right?
Turn on Do Not Disturb.
Yeah.
Before we move on, Dean mentions in the chat for the F-string thing,
you can put layers of curly braces in there.
What? Like F-string within F-string? No way.
Yeah.
I feel like we're reaching a dangerous point.
No, that's awesome awesome that's so cool
love it for people who are listening i'm not seeing this yeah yeah so for people listening
you would normally have an s string you say f quote you know curly bracket variable close curly
and with the format as a colon so dean is saying that if you put as the format string curly
variable that contains the format curly so like curlies within curlies
that'll do it that's awesome thanks i had no idea and i have no idea how you found that out but
that's good yo dog i heard you like curly braces i love them very cool very cool all right let's
see oh i'm next cool um i want to cover a a cool article called um from Vitor called How to Start a Production-Ready Django Project.
And this is sort of just a fun project article because it's focused on Django, definitely.
But I think a lot of this advice is just a good idea for any web app or I guess it's mostly web app stuff.
But anyway, it's worth a look even
if you're using some other uh framework well um he starts out just said at the beginning when you
get started project just start it out right so um one of the things that i thought was neat was
uh making sure that you set up a local environment a test environment and a production environment
uh the low and the easiest and most important is the local environment so a test environment, and a production environment. And the easiest and
most important is the local environment so that new developers can get up really quickly and just
start, clone, and go. And I think that's really important to make sure that that's working well
and easy. And then almost as important, and I would say maybe more important, but is a test
environment. So if you've got, if you're swapping out
like a different database or something for your test,
making sure that that's configured and set up
so that the developers, when they're contributing,
can easily run the tests before they submit code to you.
So that's really important.
And then the production environment
and the setup for that,
that is an interesting argument that that can be more complicated.
That can be a different thing because most of the people involved in the project
aren't really going to run that.
It's just a handful of experienced developers.
I think that's cool.
So after setting up the environment sort of stuff,
it covers making sure that you have Git or some other version control set up
and use virtual environments. There you go, Jay. Make sure that you have Git or some other version control set up and use virtual environments.
There you go, Jay.
Make sure that you're doing virtual environments.
But then there's a section on requirements.txt files
that I think is amazing.
Maybe everybody knew this already,
but it hadn't occurred to me,
is to have a directory instead of just a file
and have several of them.
And the example has a base one, a test one, a local one,
and a production one, and they can include each other.
So all of them include the base and like local also includes text.
So whatever your environment is,
you can just install one of these and it's the right one.
And all the, like the, the project stuff is all in the base.
So everybody uses that.
That's a pretty cool idea.
I've never done that.
Have you done that?
Either of you used that sort of a model before?
No.
No, I'm terrible.
I just put everything in environment variables
and then I never have to change my code.
I just have to change my environment variables
depending on what area of system I'm in.
Yeah, so that that was discussion
was around their requirements but there's also a similar discussion around the settings so uh
the settings set up to make sure that you've got uh you know where the database is where your server
is and all that stuff and have those set up for and and switched for local test and production
and just getting all of that stuff set up ahead of time
right at the beginning of the project and included a couple things I was surprised to see was making
sure that you've got a consistent set of linting and styling tools like black or flake eight or
isort and then also editor configurations it might make make the whole team more productive if you just go ahead and
store your editor configurations in the project. I never considered doing that.
Yeah. One thing that's really cool is for PyCharm. I don't know how VS Code works. There's maybe
something for it as well. But in PyCharm, you can go and customize the code cleanup and formatting
and rules of what it inspects and how it'll fix them. And then instead of saying, save that in my like user profile, you can say, save this in the PyCharm project.
So if other people on the team open it up and it won't show squigglies, if like your convention is different than PEP 8 or if you format it, it won't jump around and stuff.
That's cool. And then, of course, there's some Django specific stuff like application structure and stuff.
But I think, like I said, even if you're not using django this is a good set of things to look through yeah yeah cool i guess i do the thing with the requirements have like a dev version
that's based on the production version and whatnot but uh yeah with settings i hadn't really thought
about that that's cool neat indeed indeed uh let's see jay you got the next one? I do. And just as I always try to bring some type of productivity app tip or trick, this time
it's a Mac app.
I'm sorry, folks in Windows land.
It's Mac only.
But I'm sure you could do something similar with like AutoHotKey or one of the similar
tools.
But I'm talking about a program that a friend of mine, Brett Terpstra, made called Bunch.
It is interesting in how simple yet complex it can get.
So those that don't know, I work on,
I help Mike out from time to time,
more specifically with the TalkPython newsletter.
And this is literally the bunch that I run every time I start working
on the newsletter. So the thing about Bunch that's really cool is one, it uses front matter
to set up a bunch of different settings within the program. So that's what you see at the top.
But now here's the title of the thing. I want it to run sequentially, not parallel.
And then if I want to open an app, I just type the name of the app.
If I want to open windows within that app, I just add a dash and provide the URLs or the file names
for those files. If I want to run like Safari and then it has three nested things that are URLs.
So what it does is it opens Safari and then launches those three tabs.
Yep. Perfect. And I actually don't even have to tell it to run Safari. I just kind of do here.
So people reading it can make sense of it. If I just put three URLs on there, it would just open
up whatever the default browser is and then open those files. But by putting Safari in front,
I tell it specifically open these in Safari. So if you work with Chrome or if you want to do something like
testing on multiple browsers, you could put each browser and then dash whatever the URL is for that.
But the thing I like about this is it also supports things like XCallback URLs, which are
kind of a URL structure for running commands in applications that support it. You can add system commands and
commands to Bunch itself, like throwing a pause in. If I wanted to actually go in and type,
like at the end, whenever I finish the newsletter, I open up messages, I hit command F,
which is that at sign in F, pause for a second, because sometimes my Mac is slow. And then I type in Michael Kennedy and hit
enter. And you can even do some conditional stuff. Like I have an Apple script that just checks the
date. If it's in the date range that I need to, to make sure that I send bills off properly,
then it also will open up, you know, Stripe and let me do my processing thing. But it supports
shell scripts, which means it supports Python.
I actually do have a couple that I'm running.
Well, I haven't ran in a while,
but it just opens up
and it kind of does similar
to what we were talking about in the first topic
of like just going in
and making sure that projects are up to date
because I will forget the commands
or I will mess them up.
And it's easier if I can just follow along
with what it's doing.
And there's a lot of different tools here.
I don't have enough time to talk about all the things it can do.
One of Michael's tips that he left off setting do not disturb.
I could do that by just typing in parentheses D and D like that.
And it'll set do not disturb whenever this runs.
And you said something like this as a like part of your um z uh your
profile shell setup so when you log in it like kicks off one of these to sort of configure your
environment the way you like it so like for example i i like want to log in and i want the
first hour to have no notification so i can just focus when i got energy in the morning and then
like turn off dnd later or something like that So that's the cool thing with front matter is like you could just say start on.
And, you know, if I start my day at 7 a.m., I just put start on 7 a.m.
And, you know, I would just create a second bunch that says, you know, start on whatever
I wanted to end and then it would turn it off like D&D off.
I think you can actually even do like a close on.
So I could even say like close on like D&D off. I think you can actually even do like a close on.
So I could even say like close on like 8 a.m. like that.
And I don't know about that last one.
I have to test that.
But there's start at,
so you can have it run on certain days of the week.
There is not a way natively to have it run on a certain day of the month.
It doesn't have cron support,
but there is a workaround that I've highlighted
in another video, which speaking of, i talked about this on my youtube channel which is youtube.com
slash kj miller my handle on everything that i do that's cool you got a nice youtube video that
walks through this right people can check that out yeah and i break down everything that's
happening in this particular bunch like even the the Apple script, which is actually JavaScript,
but it's fine.
I would have expected D&D
to like send out Dungeons & Dragons
invites to random people.
Well, funny enough,
if you had a bunch called D&D,
you could just do D&D.bunch like that
and it would just run it.
So that is doable.
We can make that happen.
Yeah, all right.
Everybody get some Mountain Dew, order a pizza, show up.
I don't know.
How's this going to go?
Exactly.
By the way, Bunch is free.
If you go to bunchapp.co, you can just install it and run it for free.
Again, the developer, it's a solo developer, Brett Terpstra.
He makes other mad science on the internet.
And I believe he works for oracle now uh just recently
so um yeah and then if you're an alfred user which i can't really i don't have a good way of showing
you what alfred is but if you know you know um i am the maintainer um the command space for mac
or the powershell like little pop-up search in windows but like as a dedicated app that does more right
exactly and i am the maintainer of the bunch workflow like the official unofficial uh bunch
workflow for alfred so if you ever need help with that you know who to yell at that'd be me
fantastic oh that's a cool one a nice find there cool all right brian is that it for us
our main items it's that's up for our
main items do we have anything extra i was thinking no and then actually yes so i just ran across this
we talked about github co-pilot in fact that was the title of last week yeah it was like github
your co-pilot your pilot speaking or something like that and how both mind-blowing and like
good and possibly kind of crazy not necessarily good ways that the how both mind-blowing and like good and possibly
kind of crazy not necessarily good ways that the co-pilot was and it was it was pretty interesting
right yeah so there's an article over on the verge and you know i had pointed out like what is the
license what is the transitive license here what's the if you have a gpl license and then you filter
it through ml is the transit of a property
applied to the GPL basically was my question, right?
And so there's an article over on The Verge that says GitHub's automatic coding tool,
aka GitHub Copilot, rests on untested legal ground.
So there's one section in here that says, despite GitHub's assertion, there's no direct
legal precedent in the United
States that upholds publicly available training data as fair use. So anyway, if people are
interested in this, they can check it out. I think there's also a caveat there too of
what GitHub is doing is on untested ground and your usage of what GitHub is doing is also on untested ground.
Not saying that you can or can't use this,
but just know that even if GitHub, you know,
wins a lawsuit saying that they're good,
you may not want to be the person to have to test the lawsuit
of whether or not you're going to be good.
So, and again, I'm not a lawyer,
so I don't even pretend to be one.
Yeah.
I take these as a cool project though.
Yeah,
it is.
It is quite cool.
It's quite cool.
All right.
Dean,
I always appreciate the help in the comments.
So time for some extra,
extra,
extra,
extra,
extra this time.
Actually,
no,
I almost had no extras at all.
I was feeling bad,
but I just the one.
Yeah.
Okay.
So I wanted to share something exciting so also one more thing
i i don't know if i click this or you but magnus says i also saw that co-pilot spouted api keys
so we've heard of shaget and other don't put secrets in here but here's yet another interesting
way you want to connect to aws here here's the api that Here's the API key. That's awesome. Go ahead and try it.
Why not?
You don't know who's paying for that.
It's free.
It's free for you.
Yeah.
So I'm continuing to work on the PyTest book.
I just got the configuration chapter turned in.
It's not available in the beta yet, but it will be within the next few days.
So configuration stuff, it's all fun.
And then I'm excited to get working the next chapters
i'm going to start working on our talks and ci and the search path and debugging and those will
be fun chapters so yeah i just wanted to share where i'm at there awesome you're you're almost
there yeah and then i had an extra too but it's it's so silly but it's just fun um i have to stop
sharing that and i have to share another window now. Thanks. Thanks, Streamer.
Thanks, man.
But I found a new tool to play with.
It's called Monodraw,
which is a very, very interesting tool.
I don't know what most people would use it for,
but I've been using it as an outline and planning tool.
And I'm going to show you what I do with it.
I'm going to add a text here and it's going to say,
Hi Python Bites Crew and I'm hit done.
So for people listening,
this is like kind of drawing on graph paper.
Yeah.
Yeah, okay.
So what happens if I expand this out
and I tell it I want it to be a banner?
What? That's pretty fun. I want it to be a banner oh well that's pretty fun it turned it all it's all
in it turned it into like ascii art and stuff yeah so this is a way to actually build like
outlines and they have a bunch of different versions and i mean i've i've used this on a
couple of projects uh i'm trying to see if i have one that I can load up real quick for like a video that I've made.
And when I say it doesn't make sense why this works for my brain, like it truly doesn't.
But when it comes to did it did it not move it to there?
It didn't move to the right window.
Hold on.
Thanks again, StreamYard.
OK, I want to use this for my next status
report and just do the the entire status report in askyard yes so but you put as a comment and
check it in funny you mentioned that because when i do my video planning i do it in this format and
it's great because you can you know you, you can move stuff around, you can draw arrows, you can highlight different sections and, you know, know how everything is going to
look there.
And when I say like, I was able to, in a normal time, it would take for me to do a video.
I like cut that time in half by just drawing an outline out, using the different ASCII
art to make things work.
I'm going to build like presentations with this. I don't know. I'm going to like give a conference talk using ASCII art to make things work. I'm going to build like presentations with this.
I don't know.
I'm going to like give a conference talk using ASCII art one day.
You can copy and paste, but you can also export it as a PDF.
Let me see what options they have here.
You can export as PDF, scalable vector graphics, or I'm sorry,
ping, text, or SVG, those three. For some reason,
I thought there was a PDF version in there, but there is not.
Sean out there was asking if you could export the art. And hey, Sean,
co host of the teaching Python podcast.
And I guess the the thing is, it is $5. And I have a link in the show notes for it as well.
But really fun tool.
I haven't figured out all of my use cases for it, but I know that creating outlines
and stuff has definitely been a very interesting and effective way of using it.
And it's called Monodraw.
And again, it's a Mac only app.
I'm sorry, Windows folks, but I'm sure that there's something out there.
And if not, build it.
Yeah.
Or get one of
those weird mac os in the cloud as a service that's true that that one was mac only to my
knowledge yeah yeah all right all right you you yeah i think it's time for a joke okay so imagine
that we're here meeting for a startup and we're you know trying to figure out we're
going to create you know some new api here and we just we're having a bit of a trouble so um
let's see so this is like a little bit of a comic strip and i guess jay you want to be the person
of the computer i'll be the bearded dude and brian you can be the the guy the glasses other
glasses all right um so they're trying to think about what to name this API, right?
Or this thing.
So data?
Nah, too generic.
How about data DB?
Unclear.
Well, let's say list completed.
Already used that.
Array list data completed then?
Nah.
We must choose now or the client might cancel the project well how about array list completed from
form without duplicate no that's too long and then the next panel has like a newspaper
clipping that says unable to name variable they go bust yeah exactly go out of business they
couldn't choose naming that that is one of the hard problems with computer science, right, is naming.
Yeah.
Yeah.
Definitely.
I didn't see completed form
or completed form without duplicates.
Like, that's what I see.
It's almost like the array list,
which, I mean,
if you're making good,
like, readable code,
you would know that it's an array list.
So I would say, yeah.
Do completed form without duplicate. Yeah. Well, you would know that it's an array list. So I would say, yeah. Do completed form without duplicate.
Yeah, they would have,
well, you would have saved them.
They'd still be in business.
Or unique.
Unique, like, completed unique.
Just everybody,
just use foo, bar, and baz,
and then nobody will complain.
So do you remember those, like,
those Microsoft-isms
where they would like
prefix types variables with their type names hungarian notation like sz for string what the
heck was the z there for size size that's right yeah oh my gosh that was dreadful terrible yeah
with like three characters left over for the actual variable name
anyway cool well this was fun thanks jay for showing up today and thanks michael as always Yeah. With like three characters left over for the actual variable name. Anyway.
Cool.
Well, this was fun.
Thanks, Jay, for showing up today.
And thanks, Michael, as always.
Yeah, you bet.
Bye, guys.
Thanks so much for listening.