- Podcasts
- Python Bytes
- #333 Live From PyCon
About this episodeTopics covered in this episode: Introducing Microsoft Security Copilot PEP 695 – Type Parameter Syntax Auto-GPT Astral: Ruff is now a…
- Introducing Microsoft Security Copilot
- PEP 695 – Type Parameter Syntax
- Auto-GPT
- Astral: Ruff is now a company
- Extras
- Joke
Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
#333 Live From PyCon
This is episode 333, half of a beast, recorded April 21st, 2023. And I am Brian Okken. And I'm Michael Kennedy. And we are live at PyCon US 2023. Yeah, it's excellent to be here. Thanks everyone for coming. It's awesome. It's a real honor. So, shall we kick off the show? Let's kick off the show. I think first I'd just like maybe to get your thoughts real quick on PyCon, the Expo, people.
How's it feeling this year? Well, it's the first time I've been back from the pandemic. I didn't show up last year, so I'm pretty excited. It's really good to see people. There's people that I haven't seen in person since 2019. So, it's pretty awesome. How about you? Same. It's really great to reconnect with a bunch of people and see folks I haven't seen for a long time.
So, Microsoft has found a way to use their large language models behind OpenAI and the stuff that powers ChatGPT to help security defenders, they say. Like, if I'm on the blue team trying to stop people from breaking into my company, I could use a little bit of help with that. And you can already use ChatGPT for all sorts of crazy programming and security type of things, right?
You can say, hey, dear chat, I would love if you could help me write a phishing email that looks convincing. Or I would like you to help me identify things I might test for misconfiguration Nginx files and what I might do with that, you know? Those are all bad things. But this project here is called Microsoft Security Copilot.
It says, empowering defenders at the speed of AI. And so, basically what this is, is it's ChatGPT. But instead of using a general purpose language model is using a cybersecurity focused large language model that understands things like, don't let me get hacked, buffer overflows, configuration files, that kind of stuff.
It was certain it was right. But it wasn't. So, this has a feedback loop. You can say, no, no, that's actually not misconfigured security copilot thing. That was okay. And here's why. And so, you can have this loop that you would have with, you know, maybe with like a junior cybersecurity researcher or whatever.
Like we're going to scan repos and maybe it doesn't matter if it's GPL. If we filter the GPL out through some kind of neural net or, you know, get all the Getty images. And now we can create really cool pictures if you ask for it. But the Getty wasn't on board with that. So, this data story is kind of a little suspicious for these.
But with this one, they explicitly say your data does not get shared back. It doesn't go anywhere. This is like, you can even lock it down about how other people are allowed to access. So, that's kind of cool. And yeah, they're basically trying to help people go through log files and other things on the server where people are trying to hide their tracks, behaving normally but not really, and pull those things out.
Now, I have no experience with this. But I know I interviewed some folks on Talk Python who are astronomers looking for exoplanets. And they were able to take old Kepler data and apply some machine learning and computer vision and discover 50 new exoplanets that people thought they had already analyzed.
And guess what? They were hiding. They couldn't be discovered by people. But by computers, they could. I suspect the same type of thing is true here. They're like, there's 10 million lines of log file. And these three are suspicious. But nobody really noticed, you know. So, anyway, if you're in cybersecurity, definitely give this a look.
The abstract is this PEP specifies an improved syntax for specifying type parameters within a generic class function or type alias. It also introduces a new statement for declaring type aliases. What does that mean? Well, I like to – it has some great examples. So, we go – if we go down to the examples, there – it's the old way.
Like, let's say I've got – one of the examples is great. So, let's say I've got a function like that takes – it takes something. We don't know what the type is. But it takes something and then it returns the same type. Or it takes something – it takes two of – it has to have two of the same typed things.
It's pretty new, I think. So, yeah. Yeah. I'm laughing because it's rolling over so quickly, right? Yeah. So, the – anyway, the old way to do it was from typing import type var. And I didn't even know you could do this. And then you declare a new type using, like, as in this example, underscore t equals type var.
And then in parentheses, underscore t. And then you can use that as the type of arguments. And that's really kind of ugly syntax. And the new proposed syntax is to just give a bracket, like bracket t bracket after the function to say, basically, it's a templated function. Like all the other generic statically typed languages, like C and stuff, right?
Yeah. So, it definitely reminds me of, like, the type – yeah, the – Templates. Templates. Thank you. In C++ and stuff. So, it's definitely easier. I still – I'm not sure. So, it's approved. So, we'll get this in 3.12. It's definitely better than the old way, but it's still – I think we might be confusing people with this.
What do you think? I think types in Python are awesome, but I think it can also go too far. I mean, let's ask – since you all are here, let's ask, like, how many people like typing in Python? Almost uniformly. Yeah. Yeah. Okay. But it can get over the top sometimes, I think. One of the things, though, is cool.
One of the bottom examples in this, it shows that combining types. So, like, maybe a function that takes two of the same type things, maybe that's a little weird. But it's not too weird if you think of, like, lists of things. If I want to say it can either be a list or a set of a certain type, but only one type.
How do you say that without these generics? Yeah. Yeah, I know. Yeah, I think – It is incomplete. And so it's the question of how far are you going to push the language to get that last couple percent? Anyway, it is looking a lot more like C, isn't it? I'm glad I studied that, but also glad I don't have to write it these days.
It seemed like it ran last time I touched it. But, okay, what's going on? Well, you used the lowercase l list bracket type, and only capital L list works. Like, no, the bug is you're in Python 3.9, not 3.10. This is a new feature. And I think – I'm joking, kind of – but with all these changes so quickly, like, it starts to get – you've got to be on the right version of Python or this thing won't exist.
Right? And it's going to be an error. Yeah. It used to be, oh, the last five versions is fine. Now it's like, oh, the last version is fine. We'll see. Yeah, that – I'm starting to – I'm working with some educators. And one of the tricky things in, like, universities is the – your curriculum is kind of needs to be known ahead of time.
All right. What's next here, Brian? What's my next one? I don't know either. No, I do. It has to do with AI probably. So this one comes to us from Matt Harrison, who's here at the conference, if you want to say hi. Obviously, there's all this GPT stuff going crazy. But one of the challenges is you can ask it a question, and it'll give you an answer.
Right? Like, hey, please write this code for me. And it'll go, boom. Here's – you don't need to hire anybody. Just take this code and trust me. Or whatever, right? You ask it a question. And you can ask it a couple of questions, but it has what's called – was it a token stack or something like that?
It only has so much memory of, like, the context of what you're asking it. And the ability to go and ask it to do one thing and then based on its response, go do another and then a third after that, it's not quite there yet. So there's this project called Auto GPT. So if you have an OpenAI API key, basically, so if you pay for OpenAI or somehow have access to it, then you can plug it into this thing.
And what it does is you give it a mission. You say, dear AI thing, what I would like you to do is go search Google for this, figure out what you find, and then get the top three most popular ones. Go find their web pages. Take all the information out of that and summarize them for me and then make a prediction about, like, who's going to win the Super Bowl because I'm going to bet big on it.
It has long-term memory storage. It'll store in a database so you can, like, have it go on and on for a long time. File storage, all sorts of interesting things. So they have a video that we'll link in the show notes you can check out here. I'm going to mute it because I don't want to hear this person talk.
But it says, fires it up, and it says, all right, we're going to get started. And what I want you to do, your role is an AI designed to teach me about AutoGPT, the thing that is itself, right, very meta, self-referential. Your goals as a list in Python is first search what AutoGPT is and then find the GitHub and figure out what it actually is from its GitHub project.
This is all Python code, right? So this thing is created in Python. You run it with Python. I'm sure you can extend it in different ways with Python. But, yeah, it's pretty nuts. You create these little things. You put them on a mission. And you just say, go, you know, go get me tickets for this concert or go do this other thing.
All right. What do you got for the last one? I am, so we've talked about Ruff before, I think. So there's been an announcement that Charlie Marsh is now his own company and hiring people. So Charlie Marsh has formed a company called Astral. And he's made a good start. He's starting with $4 million of investment money.
So it's not a bad. That is not a bad deal at all. Bad deal to start a company. But I'm kind of excited about it, actually. Well, one, I'm happy for him. Obviously, well, at least I hope it's a good thing for him. But I just think it's neat that I guess I just wanted to highlight and say congrats, Charlie, you're doing this.
And then also, yeah. Well, this was a good idea of taking part of the Python tool chain and rewriting it in Rust. What other stuff could we rewrite in Rust? And I think that's where they're headed is making more Python things more Ruff-like or Rustifying them. So I'm excited for it and to see what they come up with.
Anything like people were trying to bring money. It seemed really suspicious. Like, what is your motive here? Are you trying to corrupt our open source environment? And I think since then, we've kind of found a way where there can be commercial interests that don't undermine the community, but also come in and benefit.
I mean, we saw Samuel Colvin with Pydantic. We're seeing this now. And, you know, a lot of them seem to fall. Textuals. Textuals. Absolutely. Will McGugan. Out with Rich. Sorry, Will. And a lot of them seem to fall under this what's called open core business model where, like, the essence of what they're doing, they give away for free.
Like Rich. Like Pydantic. But then, on top of that, there's something that is highly polished and commercial, and that's where they're kind of working. And I, personally, am just really happy for these folks that this is happening. I think it creates more opportunity. It creates more opportunity for people in Python.
I mean, there's a lot of things that people are happy with their normal job. But they're doing something cool on the side. We still need to figure out how to compensate those people better. Yeah. So we'll figure that out. One of the things I wanted to bring up is I was talking about this announcement with somebody just yesterday.
So yes, it says Ruff is compatible with black out of the box, as long as line length setting is consistent between the two, because black has a weird line length thing. I've had no problem with running them together. And I was like, also, should I run them together? And right in here, Ruff is, it says Ruff is designed to be used alongside black.
And as such, we'll defer implementing stylistic lint rules that are obviated by auto formatting. So what does that mean? It means that there's no point, if they're assuming that you're running black. So if running black will do something, there's no point in Ruff checking it, because they know that you've already done it.
Yes. Wanted us to bring up, which, sorry, Matthew, for me forgetting your name right away. Former Python Bytes co-host, guest, attendee. Yeah. So, I wanted to announce that the tickets are available. It's now open. You can buy tickets to SciPy 2023. And SciPy 2023 is in Austin, Texas, on July 10th through the 16th.
I think it'd be great. But I can't make it. I'm coming home from vacation on the 10th or something like that, which makes it a little tight to get all the way to Austin. Yeah. All right. Do you have any extras? I have one extra, nothing major, kind of a follow-up here. The mobile app, I talked about that.
It's completely redone from scratch. It's very nice. But it needs a little testing across all the zillions of devices. Android is out. Do you notice, Brian, I did not say the Apple version is out, did I? No. Oh, no. No, no, no. Because when you submit something to Apple, what they tell you is, rejected.
Rejected. Your app does not do X, Y, and Z. And Android is like, yeah, sure. That's good. So we're now adding in-app purchasing because without it, you can't have your app. So I'm going to work on that for the next week. And then we'll have an Apple version y'all can test. And it will be out, but it's just not out yet.
We've got the senior dev and we've got the junior dev. Here we go. Here we go. What is this, Mr. Bean? Yeah. Mr. Bean. It's just people are rocking all over. The junior dev is hanging on for life. There's like a molten lava here in a second. That's the database. Some of the developers are thrown into the lava.
