Python Bytes - #229 Has one of your dependencies died?
Episode Date: April 15, 2021Topics covered in this episode: Coverage.py (5.6b1) and third-party code So you want your own PaaS? Piku! Web3.py Deadpendency All The Important Features and Changes in Python 3.10 freeCodeCamp’s... Python Curriculum Extras Joke See the full show notes for this episode on the website at pythonbytes.fm/229
Transcript
Discussion (0)
Hello and welcome to Python Bytes, where we deliver news and headlines directly to your earbuds.
This is episode 229, recorded April 14th, 2021.
And I am Brian Ocken.
I'm Michael Kennedy.
Hi, I'm Gwen Fardy.
Hey Gwen, great to have you here. Thanks for coming.
Yeah, thanks for having me.
We invited you because you're doing really cool stuff with Python
and you're doing some neat things on YouTube and some...
Are you doing live streaming as well or just videos?
Maybe just tell people real quick about yourself before we get into our topics. Yeah, sure. So I work as a senior
software developer at a consulting company. We do almost entirely Django projects there. And I've
really loved getting to use Django for the past couple of years. On the side, I also teach at a coding school where we do full stack JavaScript,
but most of our backend and computer science curriculum
is actually Python.
And then we also use Django
for the final portion of the curriculum
as well as the final project.
And then on the side, as Michael mentioned,
I really like to make videos and content and things like that. So I've
done a mixture of JavaScript and Python content under the name Faraday Academy. And I also have
Twitch live streams. So most recently for Python, I've been kind of diving into fast API live and
trying to learn async Python since I haven't really done much with async Python
in the Django world. Nice. Yeah, super fun. Fast API is great. Yeah, it's awesome.
And technology to work with. So you sound like you're busy, but in a good way.
But I love programming. So it's like my passion. It's not burdensome, I guess.
Yeah, it doesn't count as work. That's great. Brian, you want to kick us off? Yeah, the first story I want to cover is about coverage. Couldn't help the bad pun. So
Ned Batchelder put a post out just the other day. There's a beta out for coverage. It's a
5.6 beta one. And it's it's a big revamp.
Well, I don't know how much code he changed,
but he says it's a big deal.
The thing that's exciting about this is,
it's supposed to exclude third-party packages.
This is actually amazing because in the workflow,
one of the problems I've had before is,
I'm just starting out I've just got some,
just starting out with a project say,
and I got some code in,
in a directory.
I've got my virtual environment.
They're also same directory,
throw some test code in there.
And,
and I want to tell you,
you're going to have to tell coverage.
If you don't give it any flags,
it just measures everything.
But now it doesn't.
Now,
if you,
if you say like coverage run PyTest
or coverage run your, like whatever your module is,
because you can run coverage without tests too.
That's a thing.
It just grabs everything and reports everything.
And that's hardly ever what you want.
So the change in 5.6 beta 1
is to knock out the third- party packages and not collect those.
And I tried it out on a couple of projects. I want to try it out on more. But like, for instance,
if you do it on your current direct, even if you say, give it just your current directory,
it's going to include all your virtual environment there if it's there also. And you don't want that.
So this is a really cool thing.
And it's beta because you'd like to hear from people
to find out if there's problems.
So go out and test it out.
I haven't tried it on PyTest plugins yet.
That's what I'd like to do next.
But this is cool.
Yeah, that's really nice.
Because obviously, you want to have code coverage of your code.
But you absolutely have no interest in testing other people's projects right there are packages that you're using and
whatnot so yeah that's perfect do you have to do anything to make this turn on uh well yes you have
to right now because it's in beta you have to initially you have to install coverage equals
equals we've got we've got in our show, but coverage equals equals 5.6b1.
It's also in the blog post that we link to.
But, and it works with,
so I tried it also with a pytest-cov plugin.
And if you install pytest-cov
and then install this other version of coverage,
they'll work together
and you can use them together too.
So.
Yeah, very nice.
Gwyn, what's the coverage story for you all?
Do you do unit testing, code's the coverage story for you all?
Do you do unit testing, code coverage, analysis, things like that?
So as far as for our Python and Django projects,
we do some testing.
I would say not enough testing.
So just like most companies I've worked at,
we always have the discussion, we should do more testing.
And sometimes we do more testing and sometimes we don't.
So our development team has been talking about it. So actually this package, coverage.py, I've never used before, but I was reading about it in the show notes and looking it up before this episode.
So I was like, oh, that's a really nice tool.
I think I'm going to use it. But mostly we do unit testing on like really complicated areas that we think might break or might have edge cases or something like that.
That's actually a great use for coverage because you can like if you specify the sort like which source to cover,
you can zoom in and say, I just have this little directory or these few modules of code.
You can say just cover those, you can say, just
cover those.
And you can check the coverage on that.
That's interesting.
So you could generate reports on different areas even.
Yeah.
Nice.
Yeah.
I only care about this part.
So just tell me about this part.
Yeah, that's perfect.
Yeah.
All right.
Well, this next one that I want to cover has to do with platform as a service.
So we often hear about Azure, AWS, and in the Python world, Heroku is very popular.
But, you know, these platform as a service places where you get push your code and then it makes servers go and new versions get deployed.
And who knows how that happens?
It's all well and good if you want to run in the public cloud.
But what if you want to run just on your own servers? So Ian Maurer sent over this thing called Piku. So Piku is the
tiniest pass platform as a service you've ever seen. It allows you to do a get push deployment
to your own servers. Isn't that cool? So yeah, yeah. So the idea is you basically set this up
on your server and then you connect it basically directly
through GitHub.
And then whenever you do a Git push, that automatically kicks off a new server creation.
I think it probably is running on Docker or something like that, but not 100% sure.
I haven't dug into the internals how it runs.
So here you can even see on the right of the homepage, which is an animated GIF.
You can go and check that out.
But you just need to see what it does.
It says, as soon as you do a git push, it'll come along.
It says, you're remote.
As opposed to just writing objects, push done.
It continues on.
It says, remote, creating app, deploying app,
your branch is up to date.
Now your app is detected.
Creating virtual environment.
And you can basically tell it what your requirements files is, what the execute file just like Heroku, you give it a
like a proc file or something. It's called something like that, where it just basically
says when you run this project, what command do you give it, and then it just runs. And that's,
that's pretty cool. So it's really meant to be especially useful for low-end devices. So I think this originates
actually from working on Raspberry Pi. So like get push deploy to Raspberry Pi, which is
Raspberry Pi clusters, which is awesome. So one of its, you know, some of its core ideas are it's
supposed to run on low-end devices. It's supposed to be accessible for hobbyists and lower school, like K through 12 school grade students.
The whole platform as a service
is about a thousand lines of code of Python, I think.
And quite functional.
It adheres to the 12-factor app
of separation of concerns
and separation of configuration and login and so on.
Yeah, it's pretty neat, pretty simple to use. And then
you just install the client and then you just do your, your get pushes with this thing. So
if you've got a bunch of Raspberry Pis or other devices you want to use as a platform as a
service, here's a pretty interesting option. If you just have also plain Linux x86 machines and
you want to make them be, you know, something like Heroku.
I went through a lot of work over at TalkByThon Training so we can get push to a production
branch and that automatically kicks off this whole workflow that, you know, not just updates
the requirements and installs the new ones and restarts it, but a little bit more than that.
It was a lot of work. This thing sounds really handy if you've got a pretty straightforward
case, but you kind of want that same workflow.
Does it just work with GitHub, or can I use it with other things too?
I think it just works with Git.
I don't think it has anything to do with GitHub itself.
Oh, okay.
Yeah, it's pretty cool.
So if you go and you watch the GIF, the animated GIF,
and you click on it, it becomes like a little movie-type thing.
You can see they start from an empty directory
with the code that they create.
The code is already there,
but it's not in source control.
Then they git init the local repository.
Then they add a remote, which is not GitHub.
And then as soon as they push to it,
it kicks off the creation and running of this thing.
I think we're going to use this
because just for like internal servers,
so I've got internal projects
that we can't host them on Heroku
or something like that.
That just ain't going to work.
But we could, you know,
update the website and stuff
and push to get and have it,
have it pull it into the server automatically.
Yeah, there's all these little internal web apps
that people run at companies
that wouldn't make sense necessarily to run on a public cloud because maybe they need to talk to
local infrastructure. And you guys even have hardware devices where you're working that you
actually talk to. So yeah, here's a way to get a better deployment story without making it your
next project to keep maintaining. Nice. Yeah, I was looking at this and I have a somewhat clunky
setup for personal projects where I have different Docker containers and watching and the Watchman
Docker container running on my servers. So I was looking at this, I was like, that's so easy.
Why don't I just use this? Exactly. Yeah, I don't know how flexible it is and how much of a general
solution it is. Cause
like I said, I already have a solution that is like this, but I'm super glad to be able to just
get, you know, get push to a certain branch. And that means in 30 seconds, it'll be deployed in a
consistent, reliable way that I don't have to think about it. It just makes it so easy to go,
oh, this, this part of the code is ready for production, get push. And as opposed to all
the steps that a lot of people go through manually
to do various things.
So yeah,
cool.
Definitely neat.
All right,
Gwen,
you got the next one,
something kind of in the news these days.
Yes.
So I got this kind of fit in with,
you know,
everything that's going on on Reddit and the news and everything.
So blockchains, I think most of you have heard of
blockchains and Bitcoin and Ethereum. And there are ways to basically build applications for the
blockchain using Python. So for example, web3.py is a popular library where you can interact with the Ethereum blockchain via a Python API.
So it's basically a wrapper that it gives you.
And there's also a similar language to Python that was built for the Ethereum blockchain.
It's called Viper.
So it's kind of Python, get it?
Python and Viper, they're both snakes.
But it's basically a Pythonic language.
So you can actually write these smart contracts or applications for the blockchain in that language or in Solidity or, you know, some other language.
Yeah. And you can deploy your applications to the blockchain and then you can interact with them or interact with any general blockchain information using Python with Web3.py.
So it's a really robust library and solution.
And especially with, you know, NFTs or non-functionable tokens and things like that being so big right now you know using web3.py you can
also interact with those types of contracts that you deploy to the blockchain and build applications
for people as well and for users oh this is really cool you know i haven't done nothing with the
blockchain and nothing with cryptocurrency so ethereum is this more
this is more a blockchain thing not a cryptocurrency thing what what's the distinction
or is it not so um cryptocurrencies basically they're built on the blockchain right or some
other type of post-blockchain technology which evolved from blockchain. So you can use this to interact with cryptocurrencies.
I think people have built trading bots and different things with these.
But you can also build really any type of application on the blockchain
and use Web3.py to interact with it,
whether it's a voting application
or some kind of exchange
or whatever you want to do on the blockchain,
you will have the API interface with Web3.py.
And just bring up non-fungible tokens
because of all the artwork
and all the hype around Dogecoin.
Yeah.
I'm thinking of taking a screenshot of Brian and we can make it a non-fungible
token and sell him.
What do you think we could get from Brian?
We could take multiple screenshots and just
sell like hundreds of them.
Yes, exactly.
I think the non-fungible
token stuff is really interesting.
It's really far out there.
The blockchain seems to be the most concrete, practical, you know, you could build stuff.
Like you mentioned, voting and other stuff.
I could certainly see if the world could ever get it together, some kind of and also I believe some countries and localities are already using the blockchain for things like that.
Nice.
I think it's even being talked about in our own government.
They have some committees that are talking about using blockchain in different ways, of course, with securities and how it's going to affect securities, but also with other possible future use cases,
like things like voting.
Awesome.
Yeah, I'm going to have a woman
from the FEC, Federal Election Commission,
on TalkPython to talk about using Python for the FEC.
And I feel like we definitely got to talk about that.
That's interesting.
Yeah, that'll be fun.
Man, you get some cool hosts or guests on your show.
That's great.
Thanks.
Thanks.
Yeah, so I'm really excited with where blockchain is going,
being used in supply chain, in refugee camps,
in pretty much every major bank now.
Every country is looking into blockchain.
So I think it's a really good thing to get on board with.
And Python is a really easy entryway to really to prototype anything in Python.
So you'll see a lot of people want to find out about blockchain and they'll build like
their own test blockchain in Python to understand it.
But there are also libraries where you can interact with real blockchains like Hyperledger
SDKs and Python.
So you can use different kinds of popular blockchains or the most popular blockchain now, which is Ethereum.
So you could interact with that via Web3.py.
Yeah. OK, cool. If people want to check it out, this is a great recommendation.
Quick question or comment from the live show.
Tune Army Captain says says at what point does this
become about monetizing this work yes or cruxes brian help me out here uh i think so yeah today
it's gotten there today absolutely all right well very cool very cool recommendation what's the next
one that you got here brian i checked this out. I'm super excited about this. This is a great idea. Yeah. So this was a recommendation from
Johannes Lippmann. He mentioned in episode 227, we talked about Snyk, S-N-Y-K.
Snyk. Snyk. Snyk Package Advisor, I think it was. Yeah. It gives you
a health recommendation or health score on any Python package.
Well, this is a similar,
well, it's not really similar.
It's I guess in the same category.
So dead dependency.
So D-E-A-D dependency.
So this is a tool that's got,
there's a paid version, but it's free for open-source projects.
It's a GitHub thing or GitHub application that you plug in.
Yeah, GitHub app.
What it does is it looks at your dependencies.
It looks at a lot of stuff.
I'm just going to bring up an example. and it looks at a lot of stuff.
I'm just going to bring up an example.
Somebody wants to add some functionality to your service or your project.
They change it and it adds a dependency.
One of the things you'll see in the pull request
if you use this is a dependency will go out and look
to see how healthy that dependency is.
So you've got a new one in there and it's got a whole bunch of configurable options that I really think are pretty cool.
It checks for things like how recent was wanted to make sure that there's recent releases, recent commits.
And they're pretty broad.
The defaults are like,
has there been a commit in the last 12 months?
Can you scroll down just one page to the jQuery example?
Yeah.
That's a great example right there.
Yeah. Their example is you've got a jQuery UI that's added,
and what it does is it doesn't just check for one thing. It looks for all of
your dependencies and it shows that, you know, a couple like jQuery UI hasn't been released for
over 12 months. And then a package called nom nom that's a no commits for the last nine months.
And it's been deprecated in the package registry. It checks for deprecations and
also things like
if it's been deprecated or
if it's gone down to a single author,
maybe that might be at risk
for some projects. But all of it's
configurable, so this is pretty neat.
Yeah, I love the idea. And it works
not just for Python or as JavaScript
as you mentioned, but also Rust,
Ruby, C Sharp, Kotlin, a bunch of stuff.
Yep.
There are some.
I tried it out and I couldn't get it to work,
but I know why I couldn't get it to work.
I'm using Flit now,
so I'm using pyproject.toml for my dependencies and stuff in my projects,
and this doesn't support it yet.
It supports requirements.txt and pipfile.
And last night I was playing with it
and I sent him an email and said,
it'd be really great if it would support setup.py
and pyproject.toml.
And gosh, within an hour, I got a response back and said,
yeah, you're right.
We should do pyproject.toml.
It's a simple format and we'll try to support it.
But setup.py, a little more difficult because as
we know setup.py has no real restrictions on its formatting so there's a lot of crazy stuff out
there for that so yeah for sure quinn what do you think yeah i was just gonna say i was i was
gonna try this out on a project but i also use So I use pyproject.toml for the
dependencies. But like you said, it's an easy format. So maybe if they support it soon, I'll
try this out. It seems like a really good idea. Yeah, it's fairly new too. It looks really slick.
Their website's all nice and great. And I'm like, oh, they must have been up for a while.
As far as I can tell, it looks like at least their defect tracker,
they've got a GitHub defect tracker
that's only been alive
since last September.
So, and they already support
a whole bunch of stuff.
So hopefully we'll get
some new features here soon.
Yeah, fantastic.
And I just came up with a new idea
for a GitHub bot.
So you have a GitHub bot
that if you put a pyproject.toml
or a pip file,
it'll automatically create the others and keep them in sync.
So if you check in your pyproject.toml,
it'll automatically generate a requirements.txt that's in sync.
And if you make changes, it'll update it.
So you can work with whatever tools you want.
That's my new idea.
Isn't everything switching over to pyproject.toml now, though? Well, for packages,
not everything is. Setup is going to be supported for a long
time, but you can use setup tools with pyproject.toml, so
there is a lot of people converting. But that's for packages
and stuff in libraries. A lot of applications don't use anything like
that. They just use a requirements file.
Yeah, I used to use a requirements file
and then I switched to using poetry like a year ago.
And I was like, what have I been doing all this time?
So much nicer.
Yeah, poetry is nice.
Very cool.
Speaking of switching to new things,
I wanted to talk about all the important changes
and features in Python 3.10.
So excited.
So exciting.
Yeah.
So this is a blog post by Martin Hines.
Apparently, blog post number 47.
Look at the URL here, which is interesting.
And basically what it does is just walks you through all the stuff coming in Python 3.10.
So Python 3.10 has been in alpha for a little while.
That means features changing,
but now it's about to go beta.
So it's about to stabilize
and it's time to start thinking about
what features are coming
because they're most likely gonna be fixed as they are.
First thing it talks about
is how to go through installing the alpha or the beta,
whatever the latest version is.
It's pretty simple.
So you just do the download and install from source,
except for it has this, this comment to say, make install. You're welcome to run make install,
but that will make your Python three on your system be the alpha Python three 10, which you
might not want to do. I mean, you may, but you might not. If you say make alt ALT install,
alt install is one word, then it'll just install it so you can refer to it as Python 3.10,
but it won't replace your system Python, which I would recommend. So there's some interesting
improvements for type checking. One of the things that's really nice about Python is you have this
optional type hint type checking, type hints, type annotation stuff, but it can get kind of
crazy with the generics. Like if I have a generator that returns a list of integer,
I mean, it's just like the way you express that
and kind of almost like generic syntax,
like generic from C++ style, it gets a little wild.
So one of the improvements is around union
because you can say, well, this thing will either take an int
or a float and I can just deal with it as basically a number.
So you used to have to say from typing import union, and then you would say union bracket
int comma float bracket. And that was the thing. So now you can just use the pipe or the or
the bitwise or operator. So int or vertical pipe float, and that tells you it's a int or a float.
What do you think of this?
Yeah, you like it?
I think it's nice.
It seems cleaner to me.
Yeah, I didn't really like it.
Wonky.
Yeah, I didn't like the union before.
I mean, I was glad it was there because we needed it.
But the or makes it nice and clean.
Yeah, I almost never used the union because it was just, it was just messy.
Anyway, this is pretty nice.
There's also some stuff about is instance.
So you can, you know, that exists already,
but you can pass this int or string,
you know, int pipe string in,
and it'll tell you if it's either an int
or a string as an instance,
which is kind of a cool thing as well.
Oh, wow.
Yeah.
You can also create type aliases,
and you could do that previously.
So if I have a thing, I want to call
a file name. And right now it's a string, but maybe it becomes a class later, because we're
going to upgrade it. And I just want to refer to it as this right now as a file name, right?
So you should say file name equals stir STR. And there's no real way to understand that I'm just
I'm trying to create a type definition. But in fact, it just tells me, well, there's this other
name for the string class, right? And that worked, but there was no way for the tools to know what
your intention was. So now there's going to be a file name, colon type alias equals string. And
that will tell you file name is an actual alias for the class string, not just it happens to be
a thing that looks a whole lot like it. So that's kind of cool. There's some stuff about knowing on integers to figure out how many bits are involved.
That's not super applicable or usable.
Disky tools.
I mean, you may want to know, but it's like not.
I doubt it's a big question people want to know often.
Disky tools are being deprecated.
They've pretty much been deprecated for a while.
You should be using setup tools and packaging
but you know they were officially deprecated in 3.10 and will be gone in 3.12 just so you all know
this next one i'm excited about uh quite a bit it's super common to want to have more than one
thing that is tied to a a context block like a with statement so if i'm going to open two files
and i want to make sure I close
them both, even if there's an error, it would make a lot of sense to say with file one, with file two.
And so what were your options, you're gonna have one with block and then indent another one just
to have the second file, which is weird, you could create the files separately, the file objects
separately and say with file one comma file two, then use them that actually worked but what if file two crashed when you tried to create it then file one would leak and there's
just like all these weird situations so now with blocks support multiple lines with parentheses
so i can say with parentheses thing one that has to be managed in the context thing two that has
to be managed in the context and so on and and then work with them. And they're treated as a block, which I think is sweet. That's gonna be very useful, because
I've had times where we've had two or three levels all the time. So yeah, yeah. So you're
usually juggling some edge case that might not quite work, but usually works. And this is just
make it part of the language, make sure it always works. I love it. Also a performance. So it brings
some performance improvements for constructors like strings, bytes, byte arrays, and so on. And then also working with functions that have type annotations, I think are something like two times faster. at compilation time. They evaluate it at runtime, which would slow them down.
So that's nice.
And then the big one is the switch statement,
which we're not calling switch statement.
It's pattern matching.
And we actually talked a lot with Brett Cannon about that.
And I think people appreciated that episode
where we got to dig into that, right?
Yeah, that was fun.
So there's some nice examples of what you can do,
like basically how it works.
You know, match on day, case Monday, case Friday, case Saturday or Sunday, and so on.
And then some more interesting ones about matching objects, like classes, where you're
looking at multiple fields.
So you can match on age and you could match on gender.
This is like a person example, name, age, gender, and you could match on different things.
And depending on how it matches, you kind of fall into these case statements. So we've gone over
that a lot. I don't want to dive into it too much, but pretty neat to see these examples here. So
that's, I would say that's the big change that's coming. Don't you think? Do the case statements
fall through like JavaScript? There is a fall through. It's not in these examples, but there
is a fall through mechanism. Okay. But not by examples, but there is a fall-through mechanism.
Okay, but not by default.
Well, it's not called default, but I think there
is. I can't remember the syntax.
Oh, I mean like
so from the first case.
Oh, right. Yeah. Yeah. You don't have to
say break. I don't think it falls through.
Yeah, it doesn't fall through. Yeah. Yeah, because
in C++, if you don't say break, you're going to
print all. It's going to run every case top to bottom, right C++, if you don't say break, you're going to print all.
It's going to run every case top to bottom, right?
Well, depending where it matches.
From where it matches onward, basically.
Yeah.
No, I don't think it falls through in that sense.
But there's a default, yeah.
But the fall-through mechanism in C++ and C and Java,
other type languages, C-like languages,
it's caused me more problems than it ever solved.
I mean, I've actually wanted it to fall through.
I'd rather have a fall-through keyword
than have it have to put a break everywhere.
Yeah, I agree.
Yeah, I just use my go-to statements and we're good.
So it's still fine.
Dean out there in the live stream says,
can't wait for 3.10 now with the double context
or multi-line context.
I agree that those are quite awesome.
I think that's a really good feature
and it's super simple.
So I like that a lot.
I wanted to add a couple things.
There's, I just found out today
that one of the things that's going in 3.10
is some better error syntax or error messages if you use an attribute view there,
if you try to access from name tuple import something else,
and you get something wrong,
it tries to give you a suggestion for what the right thing is,
and that'll be really cool,
especially for working on the REPL and stuff.
And I also wanted to point out that I don't think I would build Python.
I would just download it.
If you Google Python 3.10 download, you can get it just from python.org.
You can download it there.
Without compiling it?
Yeah, it's just the installer.
I'll put a link in the show notes.
Yeah.
Or use PyInf. Yeah, PyInf. Right, yeah, you can use PyInf. Yeah, sure. Cool. compiling it yeah it's just the installer i'll put a link in the show notes yeah use high end
right yeah you can just buy them yeah sure cool all right well that brings us to the next item
but i don't have the link to it and that's yours glenn so you want to tell us about it i think i
can just google it or i'm not going to google i'm going to duck duck go up but carry on good
i used to go to nice so yeah i wanted to give a shout out to free
code camps python curriculum so last year they launched a python curriculum with i think it's
almost a thousand hours of curriculum material between uh challenges lessons um, and of course, projects and certifications as well on topics from Python
basics to data science, machine learning, algorithms, all sorts of things. And that's
in addition to the thousands of hours they already had learning JavaScript and basic programming
skills and algorithms and other types of things. So that Python curriculum was in the works for a few years.
I've been a top contributor with FreeCodeCamp for a couple of years.
So I got to go to their summit before the whole COVID thing hit.
And I remember everyone getting together,
kind of talking excitedly several years ago about Python coming out.
So it was definitely in the works for a
long time. And a lot of people put a lot of effort into it. So I think it's a really
good curriculum. And FreeCodeCamp has also done a really good job of putting out a lot of
supplementary material in Python and data science. So you can see on their YouTube channel,
I believe they have over 100 hours of Python content,
including this one 12-hour Python data science crash course
on their YouTube channel.
And they also have one of the most popular developer blogs
on the internet.
I'm also a writer for them.
So recently I wrote one Django article,
and I have a whole bunch more Django articles that I'm planning to write when I get around to it.
So as far as Python education, I think this is a really good option that's free, accessible to anybody, even on mobile devices.
And one that stayed true to its mission. It didn't just build to kind of sell out to another company.
But, you know, since I believe the end of 2014, when it's launched,
it's kept this mission of making coding education accessible to everyone.
So I think they've done a really good comprehensive job of now adding Python onto that.
Oh, and they're also adding on, right now they're working on an even bigger expanded
curriculum for that data science and machine learning that they have right now in Python.
It's going to include all the different math and a lot more elements of machine learning than it
currently covers. So yeah, I'm excited for that. They've, they were raising money for it this year and they've been working on it since last year. So I'm hoping we'll see at least the initial stages
of that soon. Yeah. Very cool. I put my, I worked with them to put my free MongoDB course up there,
which is a Python course. Oh, awesome. A little bit up there. Yeah. What were you using with
MongoDB? It was just some some it wasn't even a real
web framework it was something that kind of was just a simple cli app that talked to it to keep
it you know not complex oh okay yeah very cool i've been using jongo or django and mongodb
okay that's cool it actually works pretty well except the migrations are a little bit funky.
Okay.
It's not easy to roll back the migrations like it is if you use Postgres.
But overall, it works really well, and you can use the same ORM you use in Django.
Oh, that's fantastic. I use Mongo Engine for my main stuff, which is very much modeled on Django,
but it's not Django itself.
Nice. Let's see. Really know, not Django itself. Nice.
Let's see, really quick, a couple of
fallbacks. Robert Robertson says they should
create an error message package that breaks down
your error into plain English.
That's a good idea. Yeah, that's a great idea.
And then Dean says there are third-party packages
that do it nicely. Brian, do you remember if we've covered
any? I don't. I mean, Dean, if you've got some ideas, throw
them out there. I think we do, but I think we did
cover them, but I don't remember them. I know we've covered stuff that do things like
pretty print the message or highlight certain parts so it's clearer.
But I feel like it would be cool if it would just print the first stack
overflow response, accepted response
underneath the crash. That would be fantastic. And we talked about
possibly just
formatting your error message nicely
so that you could Google it
or DuckDuckGo it
of like how to search for this on the internet.
So like escaping quotes and things like that.
Exactly.
That'd be cool.
Somebody else, let's see, Pylang mentioned,
and I think this is right,
that the fall through on the pattern matching
is the underscore, I think that's correct.
Is that the default?
I think that's the default case, not the fall through.
Is that right?
Right, right, not the fall through, the default case.
Yeah.
Okay.
Thanks.
So I don't think there is a way to,
I don't know, there might be a way to fall through.
There's like always, I don't know.
I haven't played with it yet.
Yeah.
Dean points out that we covered the one like always, I don't know. I haven't played with it yet. Yeah. Dean points out that
we covered the one that has,
you can ask why.
Remember you'd ask like,
why, what?
There's a bunch of W's
and we're kind of coming up
with the name of,
like a name for the,
a better name
or for another,
what we could ask,
like a WTF
or something like that.
I don't remember
what that's called though,
sadly.
That was a fun one.
Oh, that'd be a great package name,
Python WTF. All right, Brian, though. Sadly. That was a fun one. Oh, that would be a great package name, Python WTF.
All right, Brian, is that it for our main topics?
Yeah.
Yeah?
All right.
You got any extras you want to cover?
Yeah, I do, as always.
But yeah, how about you?
Well, I don't know when it'll get released, but I just recorded it. But a few episodes ago, we talked about Python Adventure.
So an adventure game, a text-based adventure in Python.
Yeah, I got to talk to the creator on the test and code.
So there'll be an upcoming test and code.
I'll go in-depth into that.
So that'll be good.
Yeah, very fun.
How about you?
Let's see.
I got a couple things.
Let's see.
This one.
We talked about the supreme court ruling
on java the google versus oracle maybe for the oracle versus google is maybe how it should be
said but i think it's just in passing interesting that microsoft has now unveiled its own java
distribution the microsoft version of open jdk to compete with oracle in the java distribution space
now i know that we're not really a java podcast sure, and I don't do any Java, but I think
it's an interesting open source follow on to covering that last time.
What do you think?
I think this is going to be big.
A lot of people already have Microsoft distributions all over their workplace.
Yeah.
Gwen?
Yes.
Any comments?
Any thoughts?
Oh, comments on Java? Yeah, yeah, yeah. This ain't workplace. Yeah. Gwen? Yes. Any comments? Any thoughts? Oh, comments on Java?
Yeah, yeah, yeah.
On this thing?
No, okay.
I got a couple more
and then I know you have some things
to throw out there as well.
PyCharm 2021.1 is out.
It has a very colorful splash screen,
which is always fun.
But its main thing is it has much better support
for a Windows subsystem for Linux.
It has better indexing,
so much faster indexing. It does cool things like if you need to type, let's say you have requests
installed, but you haven't imported it into the file. If you type RG, it very likely may propose
to you request.get as an autocomplete option. If you choose it, it'll
write import request and then autocomplete request.get all like in one tab completion.
So they've like done some really cool stuff with the autocomplete to like kind of ramp that up.
And there's a few other things as well. But yeah, anyway, if people are into that, check that out.
We covered Beanie a couple times. We covered Beanie the first time introducing it,
which is an ODM for MongoDB based on Pydantic, which is super cool, by Roman Wright. And then
I said, I reached out to him and said, oh, that's great, but you should have a way to add indexes.
So he did, which was really cool. And Gwen just mentioned migration. So he just added migrations
for Beanie as well. And there's some really
interesting ways to like write your migrations and convert from one schema to another. So basically
you say, here's the old model, here's the new model, fix it. Is more or less the way that you
say that. So yeah, that's, it's pretty cool. We already covered it, but definitely just a neat
thing to see that there're that he's adding
it so congrats on that seeing that thing grow gwyn i know you got a couple things you want to talk
about mem.dev that's that's a really cool thing i didn't know about this before but i checked it
out when you put it in the show notes yeah it's basically a spaced repetition learning system
but built specifically for developers so a lot of people use Anki, which is its own algorithm.
I also use Anki synced across my desktop
and mobile phone and everything
to learn different concepts,
mostly programming, computer science,
all of that stuff.
But one thing I like about also using mem.dev
is that there's a browser plugin
and I can directly copy snippets
from places like Stack Overflow.
In all those coding boxes, it will have like a mem.dev icon in the corner of any coding box.
And I can just copy the snippet to make into a card later on mem.dev.
Another really cool feature is it lets you practice keyboard shortcuts now.
So to get faster and better as a developer,
it's really good to practice different kinds of keyboard shortcuts.
Also, I find it helpful because things like Django have a massive API.
And as a consultant, I feel like I'm being pulled in so many directions.
It's really hard for me to keep up with everything I'm doing and still feel like I'm really good at the technologies I'm using.
So that's why I'm using supplementary resources like these spaced repetition learning systems.
So I don't forget different parts of the API, even if I haven't used it in a couple of months, because I'll have to recall that for a future project or something like that. Yeah, so I looked at this and you can go to places and
sort of save these web snippets, and then turn them into stuff you want to remember and practice
almost like flashcards. So one example is if I'm on Stack Overflow, and I see some code,
I can go to that code thing and say, make this a snippet. And then I could even upgrade that to this repetition practice.
Yeah, that's pretty neat.
And then
what about graphing Django?
Yeah, so this
probably isn't a secret
to anybody. So it's basically
kind of the standard
package to be able
to use GraphQL with Django.
But as I've been using it more and more,
because I use mostly Django REST framework. But now that I'm using Graphene Django, it's like,
oh, this is so nice. You know, I don't have to update and manage all of these different end
points. I just have one end point. And then I'm managing, you know, how my data gets sent back from my different
schemas and stuff. I feel like as your application grows, it's much more easy to manage and maintain
with GraphQL than with the standard REST interface. So that's something that I've been
playing around with a lot i want to before i use
it in a professional project i want to kind of get better with um using authentication with it so
there is um kind of a standard library for graphene django i think it's called graphene
django off and it uses jwt tokens so i'm gonna play around with that a little bit soon yeah very cool yeah so it's it's a django
enhancement built upon graphene itself yes very cool and brian out in the live stream was it that
told us uh it was dean dean told us that we did in fact cover friendly the friendly library which
allows you to ask um you know, it gives you,
when it crashes, you get like, what is it? Like a little REPL type thing that you can go ask
questions about. Yeah. That's the one where you can ask who, what, why, where. Yeah, exactly.
Yeah. I guess maybe not who, but yeah. Perfect. That's it for this one. Well, thanks a lot for
joining us, Gwen. Yeah, Gwen, it was great to have you here.
Thanks so much for being here
and keep up the good work on YouTube and everywhere else.
Yeah.
Thanks, Michael.
Thanks, Brian.
Yeah, you bet.
Bye, Brian.
Bye, everyone.
Bye.