Python Bytes - #160 Your JSON shall be streamed

Episode Date: December 12, 2019

Topics covered in this episode: Type Hints for Busy Python Programmers auto-py-to-exe How to document Python code with Sphinx Snek is a cross-platform PowerShell module for integrating with Python ...How to use Pandas to access databases ijson — Iterative JSON parser with a standard Python iterator interface Extras Joke See the full show notes for this episode on the website at pythonbytes.fm/160

Transcript
Discussion (0)
Starting point is 00:00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds. This is episode 160, recorded December 4th, 2019. I'm Michael Kennedy. And I'm Brian Atkin. And this episode is brought to you by DigitalOcean. Check them out at pythonbytes.fm. $50 credit for new users. Let's start with a topic that we've covered quite a bit, Brian. Type hints. Or do you call them type annotations? I usually call them type hints.
Starting point is 00:00:27 Yeah, I go back and forth. And the article you're going to mention actually says you can call them both. But yeah, it's kind of funky that they don't have like a definitive name. Maybe they do. And I just don't have certainty around it. Yeah, one of them's wrong. And whatever the one I'm using is probably the wrong one. So we have covered it a lot.
Starting point is 00:00:42 And there's a lot of tools that we've talked about like MyPy and others. So hopefully we've convinced everybody that they should at least do a little bit of type hinting. If you're in that boat, then this article is perfect for you. Al Swigert wrote an article called Type Hints for Busy Python Programmers. And that's everybody, right? I mean, we're all busy. We're all busy. I really like the article. It's a kind of a, when I first went to it, I was a little shocked because there's a lot of words there, but it reads like a conversation. It's a conversational thing as if it's a programmer talking to an expert. So that sort of tone of, I think I should do this, but what do I do? And so he just sort of walks through a whole bunch of questions with it.
Starting point is 00:01:23 He covers using MyPy and typing as the two modules you need and how to use those, and there are other tools, but really most people are using MyPi, and that's Al's saying that. I don't know if most people are using MyPi or some of the other tools. I don't think there's any way to gain statistics on that, but I think MyPi is a good way to start and a reminder that using types doesn't affect runtime you have to run a tool like MyPi
Starting point is 00:01:52 to get it to work I don't think he covers this but I think that people should hook running MyPi into their talks system or into their continuous integration pipeline to make sure that these these are met yeah everything's hanging together yeah yeah there isn't any compiler compiler to catch you so one of the things i liked about it is it gets you started and it covers some of the basics but there's as i've started uh running it started using type hints the exact things that i've run into al covers for instance
Starting point is 00:02:27 you got a function that takes an integer but it also could be none or the default is none or it's optional or something how do you deal with that there is stuff built in the type int system for union so you can say it's either an int or none and there's optional parameters and then a shout out to stuff that if you kind of get into it and you might, like if you're passing callables or sequences around, yes, there are ways to type that. And so I think this is actually just a really great quick read, and it'll get you started pretty fast. Yeah, I really like it. I love the conversational style. It seems super approachable, and it's kind of from the skeptics perspective it seems a little bit like oh i want to do this but what about i don't know if i'm sure
Starting point is 00:03:09 about this why can i do this and yeah it seems like a lot of fun i'm definitely a fan of type hints these days not for the my pie reasons i understand that makes sense for very large projects for but for me like the editors are just so much better if you can just give them these little hints here and there. I'll give you an example. For the database for Python Bytes, we are talking to MongoDB with Mongo Engine. And the way you specify it is much like SQL Alchemy or even maybe more so like Django ORM
Starting point is 00:03:40 where you say this column is a Mongo Engine column of type such and such. Well, the type editor, the editors think the type is like a column, but it's not a column. It's probably a date time or it's a string or it's a list or it's anything but what they think it is. And so you can use type ends to say this column is an editor and it's equal to one of these column things.
Starting point is 00:04:01 That'll tell all the editors when I hit dot on this, don't tell me it's one of these column things. I don't want to know that. I want to know what its value is because that's what I program against when I run it. So there's just all these different angles that make it super valuable. I'll have to take a look at how you're using that. That's pretty cool. Yeah, for sure. Speaking of cool, another thing that we have beaten to death, but is very tough and leathery and has not died is the ability to create an application out of Python code, right? Yes.
Starting point is 00:04:28 Well, I stumbled across this thing. I don't believe it is new, but it actually is interesting on layers. There are layers of interest here called auto-py-2-exe, autopy-2-exe. Okay. Okay. So this is a GUI and it's built with EEL. First of all, it's a GUI Python thing built with EEL. Remember EEL? I know. Okay. Okay. So this is a GUI and it's built with EEL. First of all, it's a GUI Python thing built with EEL. Remember EEL? I know. Remind me. Yeah. It lives in the ocean. Some of them are electrical. You shouldn't touch them. No way. Hold on. It's a library for making electron-like
Starting point is 00:04:55 HTML and JavaScript GUI apps with Python. Okay. It says electric snake. Got it. Yeah. Electron. Yeah, exactly. So it's very much like that. I think it's for kind of simplistic ones, but it certainly works for this app, which is pretty cool. So here's a Python app built in EEL. That's cool. And it's kind of meta in the sense that its job is to make other Python applications out of native Python code. Okay, interesting. Okay, yeah. So what it does is basically this is automation over top PyInstaller. And you might Okay, interesting. such and such. And, you know, here are the additional binary files or additional resource files I want bundled and shipped with my application. We're using this JSON file and we're using this, I don't know, this image that we're going to embed somewhere. Just include those.
Starting point is 00:05:54 And like, so there's all sorts of settings in this auto PI to EXE where you can just pick all that stuff out. And you don't really have to be an expert at all with PI installer, but you can build pretty nice stuff. Like there's a checkbox. Do you want just a loose set of files or do you want it bundled into a single.exe that I can just give and it'll contain Python and the dependencies and all that? Okay. This does sound neat. Yeah. It's pretty neat, right? Yeah. And so really people want to, if this sounds interesting to you and you want to find out, Hey, is this cool? Is this interesting? There's a three minute YouTube video. You can just check that out. Okay, cool. So I put the link to the three minute video at the end. People can click on that, watch it. And then within three minutes, you'll decide whether or not this is useful for you. But
Starting point is 00:06:31 some of the conversation I saw people saying, yeah, I know it just automates PyInstaller and that's cool, but there were things I couldn't get to work with PyInstaller, but doing it here, it worked fine. So I feel like there's a lot of value in this. Yeah. Nice. Yeah. Speaking of value, DigitalOcean, they are adding a lot of value to all the hosted things of the world, including our stuff that's hosted there across all the different sites and whatever. I believe we're doing like 15 terabytes of traffic a month through DigitalOcean. That is not messing around. That's a lot. So been rock solid.
Starting point is 00:07:00 The other thing that they have that they're just launching is the Kubernetes, their own container registry for things like their Kubernetes service. So we've got Docker Hub and places that you can put your containers, but that's on the public internet and things like that. It'd be nice to have a private little one for your private code that you want to make sure doesn't somehow leak with making it public or private on accident or whatever. So you can use their DigitalOcean container registry and have nice private container definitions, which is pretty cool, among other things. So check them out at pythonbytes.fm slash DigitalOcean. Like I said, $50 credit for new users to get started and play around with this. Speaking of playing around, I've never played with Sphinx.
Starting point is 00:07:41 Oh, you never have? I haven't. I've had no reason to do it. But it seems like something that's useful. Maybe I should learn about it. Yeah, so one of the things, Oh, you never have? I haven't. I've had no reason to do it, but it seems like something that's useful. Maybe I should learn about it. Yeah, so one of the things, so I have, what I've wanted to use Sphinx for, so Sphinx can be used for building up documentation and makes a documentation
Starting point is 00:07:55 website based on either REST or Markdown, or not, REST in that, restructured text. Yeah, thanks a lot, programming world, for having two things that could be abbreviated REST. In the C++ land, there was some auto-documentation tools to where you can take,
Starting point is 00:08:12 and I know other programming languages have this too, where you can take information about the structure of a program and automatically generate some web documentation about how to use it and what the parameters are for different functions and stuff like that. So you can do that with Sphinx, and that's the thing I've been wanting to do, and I've tried several times and failed. And it's usually because, probably on my
Starting point is 00:08:36 part, but the tutorials get me part of the way, and then, you know, they reference a bunch of documentation and stuff, and I don't want to become a Sphinx expert I want that's kind of the point of this I want to be able to just point it at my code and go go do it and like for instance I'm pulling out so what does a function do what do different tests do I'd like that to be embedded in the doc string so that when I'm coding I can make sure that that's correct and then that's just automatically generated so what I what highlighting today is an article called how to document python code with sphinx it's a short tutorial by mosh's zadka that's a cool name and uh so walks through it has a little example of a little module with the doc string and then the small example of how to set up your index.rst. And I like Markdown better, but this is so short,
Starting point is 00:09:30 I'd probably just use the restructured checks version. It points out that you need a few extensions. You need autodoc, napoleon, and viewcode. And then it just gives you the conf.py file you need to make this work. And then how do you generate this stuff? Well, there's this long, weird command. It's not that weird, but I don't want to memorize it. So this tutorial also shows you how to set up a tox.ini file with this Sphinx built in so you can just say tox
Starting point is 00:09:54 and your docs get rebuilt. So I like this tutorial and I'm going to give it a shot. Yeah, it's a really cool thing and automatically generating your documentation. Not terrible at all. Of course, it doesn't cover, like, okay, now that you've generated it, it's a bunch of webpages and stuff. Where do you put that?
Starting point is 00:10:10 But for internal documentation within a team, you've got your own way to do it, whether you're pushing it into a small web server or just leaving it with your code or whatever. So leave that to the user. Yeah, or put it on GitHub pages, right? That's one thing you user. Yeah, or put it on DigitalOcean, or not DigitalOcean, GitHub pages, right?
Starting point is 00:10:26 Yeah. That's one thing you do. You put it on Netlify. A lot of options for just hosting HTML. Or throw it into a GitHub cluster or a Kubernetes cluster. Maybe not. That's right.
Starting point is 00:10:38 So something that's always amused me is the association of Python ecosystem and language with snakes because that's because that's not the origin right that's not what python is named after it's named after monty python all these apps and stuff should have like medieval knight type of names but they don't so i'm going to tell you about one that is called snake snake snake s-n-e-k snake. Don't quite know the right accent to put on it to pull that off, but snake. It's pretty awesome.
Starting point is 00:11:08 So it's a PowerShell module for integrating standard CPython, just Python code and various packages with PowerShell. So if you're doing anything on Windows, any sort of automation or advanced shell stuff, you're probably using PowerShell, although the regular terminal is getting better as well. And the story of Python on Windows has always had a little caveat or maybe a little star
Starting point is 00:11:33 like, yeah, you always do this, except for on Windows, you type this other thing. And it's slowly getting better, right? Steve Dower has done a lot of work to improve that with, say, the Python installer that comes off the Windows 10 store has Python 3 as a command and not just Python and so on. But here's one more
Starting point is 00:11:50 thing that you can do to make working on Windows with Python better. If you do anything with PowerShell, you can write scripts now that have
Starting point is 00:11:58 sections of those scripts or libraries for PowerShell written in Python. And it uses this library called Python4.NET, which is a new modern way to share the entire blast library of.NET
Starting point is 00:12:13 and all the objects you might create there with Python code. And similarly say, this Python thing returns some funky.NET type that can be converted so it looks normal to the rest of the PowerShell land, which is generally.NET stuff. So if you're doing stuff with PowerShell, check this out. It's pretty cool. The syntax is funky, but it's PowerShell syntax,
Starting point is 00:12:34 so there you have it. Yeah, well, okay. So I think that people can't be blamed for doing the snake thing because our logo is two snakes. I know. I think that that is absolutely true i think it should be like maybe some cheese yeah exactly or maybe a shield yeah i don't know
Starting point is 00:12:51 whatever i don't mind having to be a snake the snake is cool and there's the you know the python snake it's just funny that like that's not actually the name no killer rabbit would be nice yes the killer rabbit would be fantastic if you just got an exception and that appeared as an emoji that would be beautiful yeah or maybe a failed test in pytest right you could write a plugin it unleashes the killer the killer rabbit and all that all right we're going down a bit of a hole so uh maybe get us out and talk get us back to the databases okay so databases since in python world one of the things we like to do is use pandas because pandas makes dealing with data like so much easier with data frames and stuff. And also one of the things with databases that we can use is SQL alchemy if it's a SQL based database and most of them are.
Starting point is 00:13:36 So you can just take pandas and put it together with SQL alchemy and put it together with your database and just slurp your entire data tables into Pandas data frames and then manipulate them there. So you're good to go, right? Right. Unless you have like five gigs of data, then you're good to swap and be very slow. Yeah. Or if terabytes of data, that'd be bad. Yeah. Very bad.
Starting point is 00:13:59 So all hope is not lost because I'm going to guess Arena trong wrote this article called how to use pandas to access databases and it's really great one of the recommendations she uses is don't be afraid of the command line for sql because you can play around with queries and look to see how big the shape of your shape of your data is to start with which is a good thing but then goes on to tips on how do you how to put this together correctly. And I'm just going to read out the highlights, but there's examples of all these, so I think it's great to have a look. Don't grab a whole table, limit to just the fields that you care about that you're going to actually use. Tables often have a lot of columns that you don't
Starting point is 00:14:40 need, so don't grab everything. Limit the number of records. You can either use the limit field to say, I only want to grab like a thousand elements or something. You can also combine that with just the number of fields, but also you can also pick out, say, I know I'm going to already throw away all the rows that don't have a particular value in this one field. So you can limit that in your query. One of the things you'll often run into with SQL databases, of course, is the need to use joins. And the quick recommendation there is let the database do that. Put it in your query. Don't do the join within pandas because you can do it with pandas and SQL Alchemy together, but don't. It's going to be slower. Right. Load it all into memory and have the data table merge it. That seems probably not like the best way to do it.
Starting point is 00:15:29 Right. Databases are pretty good at joining stuff. Yeah. And I mean, if you find, of course, it didn't talk about this, but if you find you're doing that a lot, you can kind of restructure some of your queries within. I think you can build that and make a join be faster. I don't know. I'm not a database person. You could put indexes. You could write a store procedure and call that. There's a couple
Starting point is 00:15:49 options. Okay. Ask Michael how to do it. Anyway, maybe not. So a lot of this is we're caring about memory. So how do you figure it out? How much memory you're going to use? And I didn't know you do this, but she has a tip tip of using query called memory you on memory underscore usage and then summing it says I don't know what the field comes back but you can do a query and grab the memory but you do like a small query like just a hundred a hundred bros or something and then take that and then you can use that to estimate the the total size if when you're going to read out like 1000 or 2000 or something. And then the last one, I actually didn't quite follow, but I think I kind of followed.
Starting point is 00:16:38 The tip is that the types get converted, like integer types get converted to like 64-bit types, I think, and you don't really need that for a lot of stuff. So I'm calling this out because it's definitely for the user, read this if you need it. But there's a little bit on using chunking and then combining that with specifying what types, pandas types to use so that you get smaller data footprints. Yeah, yeah. So for example, maybe one of the columns in the data frame,
Starting point is 00:17:04 just the way it came back from the database, is a 64-bit type integer. data footprints yeah yeah so for example maybe one of the columns in the data frame that just the way it came back from the database is a 64-bit type integer and you know everything would actually fit into an untyped and unsigned 16-bit integer well that'll save you it'll be a quarter the size of the data if you make that conversion right so got a million of them a quarter the size of a million it's possibly meaningful yeah i mean a million of them, a quarter the size of a million, it's possibly meaningful. Yeah, I mean a lot of stuff that, like for instance, a lot of stuff, one of the tables I deal with has numbers for the different specifying which kind of result we're looking at, for instance. And they each have like a number code. There's only like six, so the number can be one through six. I don't need 64 bits to store that
Starting point is 00:17:46 so yeah for sure so it's good do you use uh pandas with sequel alchemy in any of our not really uh there's a few times i've been thinking i should probably try to do some bi like graphing type stuff maybe about popularity of episodes or things like that you know figure out what day i should release our podcast on but but I haven't done anything, so no. Okay, but you do use the SQL Alchemy though, right? Some, but not for the main site because that's MongoDB. Oh, right. I'm using something equivalent, like we're using Mongo Engine, which is super equivalent.
Starting point is 00:18:16 Okay. Yeah. Nice. Cool. Yeah, I suspect there's probably some interesting MongoDB integration with Pandas that I just don't know about, but I don't know any equivalent of there. Well, this next one I'm going to cover is very similar to what you talked about. It talks about how do I basically efficiently work with data from this one source databases?
Starting point is 00:18:42 And how do I not just select star from all the tables into pandas and work on it? Another problem you might have is you have json data json is sweet but one thing json is not very obviously good at is streaming data right because how do you know where the closing curly brace is maybe you've got some key and then it's got an array of stuff and the closing bit of that array is not until you know maybe 500 megabytes down the file that's a problem potentially right so if you load it with if you just load up a you know import json and do a json load give it a file pointer it's just gonna hoover that all up and jam into it one giant dictionary and spit it out but if it's huge obviously what you want to do is iterate over and process it item by item yeah i mean that's what you would do for a regular file if you could take it line by line.
Starting point is 00:19:27 But because it's this formatted thing, it's much harder. And something I ran across last time, time before, we were talking about some other project and it said, oh, this project uses iJSON. I'm like, wait a minute, what is iJSON? That's interesting. Yeah. Yeah, so iJSON is an iterative JSON parser with the standard Python iterator interface. So what you can do is basically point it at a file stream, some search expression, kind of, in the JSON document, and then it will stream those back to you, generator style, one at a time.
Starting point is 00:20:02 That's so cool. Yeah, so there's a little example i put in the show notes it says imagine we've got some object called earth in our json document it has a bunch of continents and within each continent it lists out say cities and states and so on if that was huge probably it's not but if it were you would want to iterate over it so you just go to the ijson and go give me the items of this from this file for earth.europe.item and item is just a way to say stop there and then what you do is you say for thing in you know whatever came back from that load that you did and you just iterate over it in a for in loop that's really neat yeah and it's doing like i
Starting point is 00:20:41 was looking at the website there's an example with with grabbing it from like a URL because you might be getting it from an API endpoint. Yeah. So I'm guessing that it's not grabbing everything from the endpoint at first. It probably depends on how the endpoint is set up or even maybe how the object that's querying it back. So I think they're using URL lib or something like that there. Okay. If you would set that up to do streaming, then you pass the stream over to IJSON,
Starting point is 00:21:09 then it would probably stream it from the server and never keep it all in memory at once anyway. That'd be cool. Yeah, that'd be cool. Yeah, but there's probably several layers you've got to set that up as. I'm using generators and iterators more and more because doing lazy work is awesome. It speeds things up quite a bit sometimes.
Starting point is 00:21:26 It's so awesome, and you basically no longer have a memory issue, no matter how much data you have. You might still have a time issue, but you're not going to run out of memory, right? You're just going to blast through it one at a time instead of blasting through them all and then working on them. Oh, nice. I've got to check this out. Yeah, so people, if you have large JSON, bring out the iJSON.
Starting point is 00:21:43 Bring out the iJSON, yep. For sure. All right, well, that's. Bring out the iJSON, yep. For sure. All right, well, that's it for all of our main items, Brian. I have, for some reason, it's like a crazy news week, and I actually decided to not throw a bunch of stuff in here, but to save it until next time, because I just don't want to overwhelm everyone. But yeah, I've got a bunch of stuff to talk about.
Starting point is 00:22:00 How about you? I am just kind of in a lull after Thanksgiving. Still in the turkey coma? Turkey coma, yeah. My head's spinning. There's a lot of stuff coming up in the next couple months, and I'm pretty excited about it. That's awesome. Yeah, I'm trying to juggle between getting over that holiday break, doing all the Black Friday stuff at TalkPython training, and then getting ready for vacation. It's a lot. But in that little gap where I'm really still paying attention, there's a bunch of stuff that I ran across this week. So first of all, let's start with this. Django 3 was released. Oh, sweet.
Starting point is 00:22:35 Yeah. So that's pretty cool. And Django 3, there's a couple of things that are important about it. One is it has official support for MariaDB, which is pretty cool. The other one is that it begins the journey to the async world. Dun, dun, dun. Dun, dun. We'll cross over to the ASGI world. Yeah, so things like async and await are now making their way to Django. I saw some messages from some of the developers there saying that this is not like the full story. This is the first steps.
Starting point is 00:23:04 So we've got a long ways to go, but it's first steps, right? It's great to see them moving that way so that you get super high scalability if you need it. Most people actually don't need it. But if you do, it's cool to say the answer is not, well, now you move to Go or Node. It's you put the async keyword in front of your view method and you're good again. Yeah, I'm excited to watch this. And actually, the Django 3 release, I had dipped my toes in Django before, and I wanted to sort of wait until I knew the 3 was coming,
Starting point is 00:23:33 so I was sort of waiting for this to be official before I started up again. So now I got no excuse. I can get started again. Yeah, that's awesome. Speaking of excuses running out, the death clock does toll, doesn't it? Yeah. Pretty soon, the death clock is going to toll for Python 2.7, or 2 in general, and in particular 2.7. And as part of that, Python 2 will be removed from Homebrew.
Starting point is 00:23:56 Wow, that's big. Yeah, that's pretty good. It's just another sign that, you know, you probably shouldn't be using this. It used to be installable, Homebrew, install Python at 2 or 2 or whatever the keyword was. Yeah, that doesn't work. Not yet. Very soon that's going to stop working. So, that's cool. Big news, although
Starting point is 00:24:13 I'm not really sure what spin to put on it, so I'll just give you the news, is Gito is stepping down from the steering council. And this came to us from Vincent Polio. Great. It's a thing. I don't really know how to spin it other than that. Yeah, I mean, this from what i i got out of doing a little bit of reading is there were new elections to re-elect people to the steering council and he didn't put his name in the hat and people said uh he didn't put his name in the hat here let me put it in a forum
Starting point is 00:24:39 and there was a conversation that followed like you know a lot of people are enjoying being part of the steering council i've been on that part of python for a long time and it's not it's just not fun for me right now and i've earned some fun in the programming world so i want to work on projects and not politics and all that kind of stuff so i'm gonna let someone else take it and he also said the reason i'm comfortable doing this is it's in good hands the people already the other council member members there are great so yeah y'all don't need me. I'm still going to be around and working on stuff, but I just don't want to be on the steering council. So anyway, thanks Vincent for sending that over. That's big news, but that's about all I got to say. There wasn't a whole lot written
Starting point is 00:25:15 about it really. Okay. GitHub is freezing open source for hundreds of thousands of years to preserve it for humanity. That's pretty awesome. Yeah. So the GitHub archive program, I watched this video. It's well done, right? It's like a polished little video. Yeah. So I don't know what to make of it other than it's a thing.
Starting point is 00:25:36 They're going to put a whole bunch, all the, as a, like, they've already put a bunch of stuff in there, but I guess next spring they're going to, or next summer or something, they're going to go up and take all open source code on GitHub and digitize it into these weird... Microfish code. Yeah. Digital microfiche or something that'll last for very long. Yeah, it's supposed to last a thousand years or something like that.
Starting point is 00:26:00 And they're going to put it in some cave on an island somewhere. Greenland, Iceland? One of those two, I can't remember. Right. So, why? To preserve it. like that and they're going to put it in like some cave in on an island somewhere greenland iceland some one of those two i can't remember right so why to preserve it i don't know i'm pretty excited i have over 100 public repos they're going to be up there though that's going to be awesome i'm excited for them to get cold and yeah if um all of uh so if civilization collapses we're counting on future civilizations to be able to find this cave and figure out some technology to read these microfiche things. Wow, those ancient creatures wrote in a very weird symbol form.
Starting point is 00:26:34 Yeah. Okay, well, good luck, future selves. Yeah, good luck, future selves. Hopefully they got some hints. But anyway, that's pretty cool. And the last thing, I had talked about this Python for decision makers course that I'm working on. And basically it's a high level of why Python,
Starting point is 00:26:51 when keys at what it's good for, what it's not good for. I'm also going to do a live webcast that people can check out after the winter break. So mid January, I'm doing just a free webcast. People can sign up and come ask questions and we can just share our thoughts on,
Starting point is 00:27:04 you know, whether Python makes sense for whatever they're doing. So people can check that out. Click the link and register for free. Cool. That's a lot of stuff, man. It is. I think we should wrap it up with a joke, though.
Starting point is 00:27:14 Yeah, let's do that. As is our tradition now. All right, you go first. Okay, so a web developer walks into a restaurant. He immediately leaves in disgust as the restaurant is laid out in tables. Oh, must have been a NoSQL web developer. Doesn't want that relational stuff in there. Yeah, that's pretty funny.
Starting point is 00:27:34 That comes from a joke API that Senjitsu sent over, so I appreciate that. And this next one as well is from there, but I kind of like it, so I'm going to cover it. So last time when we were talking about pint, you talked about using prefixes and suffixes for variable names, like, so I'm going to cover it. So last time when we were talking about pint, you talked about using prefixes and suffixes for variable names, like if I'm going to have something in meters, I'd
Starting point is 00:27:50 use an underscore m, potentially, or centimeters, underscore cm, whatever convention you use. So what is the best prefix for global variables? I'm not sure, what? Maybe g? That would be, yeah, g, g underscore, something like that, if it's global, or hash. Like, you underscore, something like that. It was global. Or hash.
Starting point is 00:28:08 Like you shouldn't have global variables. So let's just comment those babies out. Comment those out. Pretty sweet. Yeah, thanks, Shinjitsu, for sending those in. Those are funny. Yep. All right, Brian.
Starting point is 00:28:16 Well, thanks as always. Thank you. Bye. 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 PythonBytes. Follow the show on Twitter via at PythonBytes. That's PythonBytes as in B-Y-T-E-S. And get the full show notes at PythonBytes.fm. If you have a news item you want featured,
Starting point is 00:28:31 just visit PythonBytes.fm and send it our way. We're always on the lookout for sharing something cool. On behalf of myself and Brian Ocken, this is Michael Kennedy. Thank you for listening and sharing this podcast with your friends and colleagues.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.