Hello and welcome to Python Bytes. This is episode 19, where we're going to deliver Python news and headlines directly to your earbuds.
It's recorded on Sunday, March 26, 2017. I'm Michael Kennedy.
And I'm Brian Ockin.
And we got some Python news for you. Hey, Brian, how's it going?
It's going really good.
Yeah. I'm excited about what you picked out. I want to learn about the ones that you got.
And I have some sort of outer loop ones that are really, really different.
I think people will be interested to hear about them. But let's start with what you got on tap.
Well, we're going to start with a story about exceptions in Python 3, not exceptions in Python 3.
But there is a person named Josh or Quix on GitHub who wrote a little utility for Python, which is actually really cool.
And it's called Better Exceptions. And it is just it's just a it's a hook that actually is pretty clever.
But it hooks into your exceptions. And so when you're like, especially when you're developing and debugging or dogfooding your own products, it will show exceptions that are color coded and split out everything that's in there.
And we have the link on our show notes. But there's there's a great picture that you can see that that shows the exceptions as they yeah.
What I like about this is that, like you said, a picture is what you have there.
And we talked about Peter, too, last week about making that sort of bland, just flat list into like something really readable and colorized and nice.
And this kind of does that for exceptions, right?
Yeah, it does. And it was really great.
And Josh works, he mentions and then it was he posted on Reddit as well.
And on Reddit, he mentions that he he works only in Python 2.7.
So he wasn't sure how to do Python 3 at first.
And he put this together pretty quickly and then put it out there for everybody.
And immediately the conversation on Reddit turned to to Python 3 and why why isn't there Python 3 support?
And one of the great things about this story is Florian, who is Paradox Zero on both on GitHub and on Reddit,
said instead of adding to the complaints list, he went out and made it.
He forked it, put in a pull request with a Python 3 fix.
And and within like eight hours, the whole thing was merged and it was Python 3 as well.
Yeah. So like eight hours of the thing being announced.
It came out without Python 3 support.
The community went in and added Python 3 support.
It's something like this, right?
Yeah. And it's just really incredible.
And I actually reached out to both of them and wanted to know if they had had anything to add to the story.
And like I was saying, Josh wasn't he didn't know how to do make sure that it was running on both because he normally works on Python 2.
And Florian, apparently he supports this tool called WDB, which is a web debugger, which actually we should explore a little bit later.
It's pretty cool.
Anyway, he's used to doing that two and three all the time.
So it wasn't that big of a jump for him to add that support, which is great.
So I like it.
Yeah, I think it's cool.
I think better exceptions.
The package is really cool.
And I think the Python 3 story of eight hours from the time it was published, somebody went and said, there's a problem with this.
It doesn't support Python.
It only supports legacy Python.
We have to fix it.
That's really cool.
I'm not sure if that would have happened four years ago, right?
Right.
And it's really great.
The other thing, when I tried this out, and one of the things that I noticed about it is you have to put an import statement in the modules that you want to use this better exceptions.
Paradox Zero also thought maybe we should modify that.
So he added another GitHub project called Better Exceptions Hook that if you include that as well, you don't have to do that import statement.
Oh, nice.
It's pretty great.
Yeah, that's really great.
Cool.
So everyone check out Better Exceptions.
Check out the Reddit thread.
We'll link to that, of course, maybe as the primary thing and all the stuff's in the show notes.
Very cool.
One of the things I always look forward to, Brian, is the Stack Overflow Developer Survey.
Stack Overflow is such a powerhouse in the software space, and they get quite a bit of feedback on their surveys, like 100,000 people filling out the survey or something.
And it's really comprehensive.
So this year, they just released a couple days ago the 2017 survey, and it has good news for Python in there.
Really?
And it looks like they get results from all over the world.
They do, yeah.
They get a ton of results, like I said.
They have stuff on gender equity, pay across different regions, job demand, all sorts of stuff like that.
But the most interesting thing to me is really around the programming languages that are being used or desire behind working with certain technologies and so on.
So there's some good news here for Python.
If you look at the most popular technologies, we talked recently about Python being the second most popular technology behind JavaScript on GitHub.
On Stack Overflow, in terms of questions, it's number five.
And given that it's pretty easy to work with relative to things like Java, which might generate more questions, I think that's pretty interesting.
So that's cool.
But let's go down a little bit farther.
They have areas where they talk about the frameworks you're working with, the databases that people are using, platforms.
But one of the things that caught my attention is languages over time.
So we've got things like C#, JavaScript, Objective-C, Node.js, and whatever, Java itself.
If you look at Python over the last five years, it went from 22% to 33%, and it's got like a hockey stick curve going to it.
So it's not just it's going up.
It's going up and the rate is increasing.
How cool is that?
That is very neat.
I like it.
If you compare it to Java, Java's on a pretty downward trend.
C# is on a downward trend.
C++, downward trend.
So that's cool.
One other one that really I like, there's a section called Most Loved, Most Dreaded, and Most Wanted.
So Python ranks very highly in the most loved.
And just let's see how the story is for most dreaded.
It turns out Visual Basic 6, VBA, CoffeeScript, and VB.net, three out of four for Visual Basic, are in the most dreaded technologies, just with MATLAB, Tal, and along.
But if you go over to Most Wanted Technology, Python, by a wide margin.
Oh, wow.
Out of everything.
That's great.
Over JavaScript, over Go, over TypeScript, over Swift, over Rust, whatever.
It's 20% of the people said, that's the thing I want most.
Who responded about that?
Isn't that cool?
What does Most Wanted mean?
It means, if you could choose, they ask, what are you using for your day-to-day job?
And they ask, if you could use anything, what would you use?
Oh, okay.
Yeah?
Just to round it out, one more thing, since I've been going on and on about Mongo and stuff like that recently.
If you go to the Database section and look at the Most Wanted database, MongoDB is like more than 2x over second place.
So, also quite interesting.
Well, working with document databases is just, I like it.
If you can do it.
It's so glorious.
Yeah.
If you can make it work, it is so, so nice.
We'll have to cover that in more detail.
But I strongly encourage you guys to go and have a look at this survey.
It's always really insightful.
They had 64,000 developers in this response.
It's not 100,000.
Sorry.
But still a huge number to make this highly statistically relevant, right?
Yeah.
And we need to get more.
It looks like there's still, with surveys like this, we still have more white dudes answering than other people.
Yeah.
That is an ongoing problem.
But what was it there?
Okay.
So, since you brought that up, I was thinking about it.
I didn't want to go on too long.
But there's a section in here that talks about, near the beginning, it talks about demographics.
And it says males, like, 88.6%.
Females, 7.6%.
White dudes are, like, 74%.
If you throw in Asians, it's super, super near, like, the top.
But there's also a section somewhere in there that talks about years of coding experience and demographics over time.
And they break that down.
They don't break it down by anything but male, female, I don't think.
But if you look at less than one year experience, there's more women than men.
If you look at one to two, there's more women than men.
It's not until you get into five years of experience that there are more men.
And then after that, it's gone, right?
It's all men all the time.
But that's pretty encouraging to me because that means people coming into the industry, there's a lot of women coming in, actually.
Yeah, that is really encouraging.
That's good.
Yeah.
So it's right that it is kind of bleak in that sense.
But there's a bit of a shining, at least a positive data point there.
I think that's great.
What do you got next for us?
Next, I've got a project called Box.
And there was an article on Code Calamity.
That's a cool name.
Anyway.
That is a cool name.
This is a really pretty simple tool.
But you just take a dictionary and throw it into an object class called Box.
And what it does is it makes it so that you can use dot notation instead of that annoying.
I mean, the dictionary notation is okay.
But it just takes so many characters to type.
Yeah.
The brackets and the quotes.
And for single word elements in your indexes in your dictionary, Box makes it so you can just use dot notation instead.
It's pretty cool.
That is cool.
I am so using Box.
So what's really nice about it, it feels like it's a little bit similar to like name tuple type things.
I mean, I guess it's dictionaries rather than names for the tuples.
But still, it's like kind of like that.
Like you take this thing you have to index into and you turn it into a thing you can use dot names on.
And while that's pretty helpful, what I think is really cool looking at this is you can have like a deep object graph.
So in their example, they have a box which has movies.
One of the movies is Spaceballs.
Each individual movie has a rating.
And you can just say mybox.movies.spaceballs.rating.
And so if that was dictionaries, that would be a lot of this dot get this dot get this dot get this or bracket bracket bracket bracket bracket, right?
Yeah.
If you're trying to test each one of those, then that's even less fun to test that it's in the dictionary.
Yeah.
And it doesn't like obviously I was trying it out.
Like one of the movies that they showed in their demo was Robin Hood Men in Tights.
Also a good movie.
Anyway, it has spaces in it.
So obviously you can't make a dot name thing with something with spaces in it.
So it just punts and doesn't do it for those.
So it's only.
Right.
Okay.
Anyway.
Yeah.
So those you have to basically use the brackets.
Treat it like a dictionary.
Yeah.
But it's enough.
Anything that saves me a little bit of typing and makes my code look a little cleaner.
I'm going to give it a try.
Yeah.
This is cool.
I think the thing that's awesome about this is it makes your code more readable.
Yeah.
Definitely.
Okay, cool.
Well, thanks for teaching me about Box.
So it wasn't very long ago that we just talked about Python 3.6 being released, right?
Yeah.
Very exciting.
Yeah.
It's super exciting.
That's a big release.
There was a lot of performance improvements, both in memory and CPU time.
And so we were already at our next release.
So on March 21st, we had Python 3.6.1 released.
How about that?
That's pretty cool.
I haven't tried it out yet, though.
I'm running it.
It's been working well for me.
It's very nice.
There are actually a surprising number of changes given the timeframe between 3.6.1 and 3.6.0
being released.
So there's a lot of fixes.
There's probably 25 fixes and optimizations for core and built-in.
If you look at the library, there's probably 35 to 40 fixes.
Things like there was some kind of bug in argparse that help messages would wrap on non-breaking spaces
and other funky stuff like that.
Fixes to the magic mock library.
So what struck me about this release is like a 3.6.1 release feels like you got 3.6.0, 3.6.1,
whatever.
It's all the same, right?
But there's actually a non-trivial number of things that I might actually want to go and
say, oh my gosh, we need to upgrade to this.
So for example, another one is fixes a crash when deallocating deep element tree objects.
So if you load up large XML files and are having problems with that, maybe you want to look at
this.
There's also sections on Windows, on the C API, and lots of stuff.
The other thing that's interesting or notable about this is I don't know if 3.6.0 or 3.6.1,
but one of those two recent releases is the first time that Python is shipping off of GitHub
since it's moved off of Mercurial.
Okay.
So that's pretty cool.
I think so.
Anyway, I think so.
I'm pretty sure that 3.5 was on the other one.
I can't find which one it is in here, but some of the core developers seem to be very excited
about f-strings now with the 3.6.1.
So there must have been some issue with it that we just don't even know about that now makes
it work better or something.
Yeah.
The only one I can find is F string expressions are no longer accepted as doc strings.
You know, that might be it.
Maybe somehow the f-strings in doc strings were being interpreted when they were supposed
to be documentation.
Like, here's the F string to use.
I don't know.
It's great.
If you get a chance, upgrade to 3.6.1.
I will.
Well, last, I've got to tell us a little bit of a story.
I went to the University of Oregon and I tried to take statistics in a building called D.D.
Hall.
D.D.
Hall was built in the 1873 to 1876.
So it's a really old building.
And I think my professor may have been born at the same time because he was a really old
guy.
And it was like on maybe the third floor.
I had to walk upstairs, little tiny room and four o'clock in the afternoon with air conditioners
blowing.
And the gist of it is, is I didn't learn statistics.
I was slept through that class.
And so I'm excited that there's a, an article called, and it looks like it's the start of
it.
It's called Essential Statistics for Data Science.
So it's teaching some of the Python data science stuff along with, and how to use statistics with
it, but also teaching you about the statistics while it's going.
And I really appreciated that.
And it was really easy to follow, even for somebody that slept through statistics.
You know, data science is actually one of the, the reasons I think for that, that growth
in the stack overflow section.
I was talking about others as well.
Right.
But I think the addition of all these data scientists moving into the space makes such, such a big
difference.
So there's a lot of people coming into the space and really having a good statistical foundation,
I think is super important here.
In this article is, it's tutorial is it also explains the box and whisker diagrams and
what all of those pieces mean.
which I had no idea what those meant before.
So, so thank you.
Okay.
Yeah.
That's awesome.
Anyway, cool.
That's all I got.
Yeah.
Okay.
Well, the last one that I want to talk about is called Hi, H-Y.
And for those of you out there that like Lisp, this will be music to your ears.
So the idea is Hi is a Lisp environment, scheme, Lisp type thing.
And you can take it, give it Lisp code and it will actually take that code and compile it
or assemble it into Python abstract syntax trees and then just hand it off to Python to execute.
Okay.
So we've talked about all sorts of different runtimes or interpreters.
We have the two CPython versions.
We have PyPy.
We have Python.net.
We have Jython.
We have IronPython.
We've got Cython.
There's lots of different choices you can make, but I've never talked about Hi.
And this was actually a listener recommendation.
So thanks.
Thanks for sending that in, guys.
So this is if you write Lisp code, you can write code in Lisp and then it just runs on
top of Python, which is cool because it means that you basically get access to the entire
standard library and all the PyPI packages for your Lisp programs, which I think is pretty
awesome.
So if you want to work with various libraries, requests, it says you can write Django applications
in Lisp.
If that seems like a good idea to you, you can use Hi to do that.
Probably Flask and Pyramid as well, I guess, because you just import it, right?
Yeah.
So yeah, they think it's a great way for people to explore Lisp if you are comfortable with Python.
Now do something for me.
Click on the link that says you must try, try-high.appspot.com and just tell me what you think when you see
that.
Oh.
That's cool, right?
So you guys all check this out when you hear this.
Click this link in the show notes.
It's what version of Apple is that?
It's not even Apple.
It's a, it's, but it looks a little bit like an Apple IIe computer.
Oh, that's so cool.
It's a little tiny old CRT and you can type on, like when you type in, you get to type right
on this little monitor.
It's cool.
It's, it's fantastic.
It's even at an angle and you get to type into the interpreter and it's live and you can
try out Lisp.
My Lisp is not good enough, but I can at least hit enter and see 42L.
Come out.
So check this out.
This is really pretty interesting if you're into Lisp.
If you're not into Lisp, I think it's just an interesting data point of here's one more
thing, one alternate way to get other languages in the Python ecosystem.
Yeah.
I just tried out the extent of my Lisp knowledge that cons makes a tuple.
Nice.
I've forgotten all about the cutter in the car and all that stuff from when I took it
back in school.
It's been a long time.
It has.
All right.
Well, that's, that's it for the news this week, everyone.
I think, Brian, you found some good ones.
Thank you.
I do want one last thing.
I want to do a little bit of follow-up.
Last week when we covered PDR2, I commented that it didn't look that great in PyPI.
And that was fixed last week.
And with one of the best pull requests I've ever seen or comments in the code, and it was
the comment was remove beer from readme.
Apparently there was a beer Unicode symbol that was messing up the PyPI stuff.
So that's good.
It's marked as a bug and urgent that we get the beer out of the readme.
Fantastic.
That is awesome.
All right.
Yeah.
Cool.
So that's, it's pretty neat that that actually, that people listen to our show and change
the projects based on it.
Right.
That's, that's awesome.
Yeah.
Or they, they may have noticed it on their own, but let's go with that.
They're listeners.
They took your advice and remove the beer.
Excellent.
All right.
Well, thanks so much for chatting with me, Brian, and sharing the news with everyone.
It's fun as always.
Thank you.
Yep.
Bye.
Thank you for listening to Python Bytes.
Follow the show on Twitter via at Python Bytes.
That's Python Bytes as in B-Y-T-E-S.
And get the full show notes at Python Bytes.fm.
If you have a news item you want featured, just visit Python Bytes.fm and send it our way.
We're always on the lookout for sharing something cool.
On behalf of myself and Brian Okken, this is Michael Kennedy.
Thank you for listening and sharing this podcast with your friends and colleagues.