惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
O
OpenAI News
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
GbyAI
GbyAI
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
云风的 BLOG
云风的 BLOG
罗磊的独立博客
S
SegmentFault 最新的问题
The Register - Security
The Register - Security
Hugging Face - Blog
Hugging Face - Blog
D
DataBreaches.Net
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
雷峰网
雷峰网
V
Visual Studio Blog
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Y
Y Combinator Blog
博客园 - 【当耐特】
G
Google Developers Blog
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
I
InfoQ
Martin Fowler
Martin Fowler
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog
AI
AI
Google Online Security Blog
Google Online Security Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - Franky
Blog — PlanetScale
Blog — PlanetScale
Webroot Blog
Webroot Blog
PCI Perspectives
PCI Perspectives
爱范儿
爱范儿
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org

Python Bytes

#487 Minimum requirements #486 underscore-underscore-ghost-emoji #485 Creating memories #484 All our tools #483 Thanks Brian #482 Mr. Beast's episode #481 Ways to die #480 Proud Parents #479 Talking About Types #478 Iodine tablets and potable water #477 Lazy, Frozen, and 31% Lighter #476 Common themes #475 Haunted warehouses #474 Astral to join OpenAI #473 A clean room rewrite? #472 Monorepos #471 The ORM pattern of 2026? #470 A Jolting Episode #469 Commands, out of the terminal #468 A bolt of Django #467 Toads in my AI #466 PSF Lands $1.5 million #465 Stack Overflow is Cooked #464 Malicious Package? No Build For You! #463 2025 is @wrapped #462 LinkedIn Cringe #461 This episdoe has a typo #460 Overlooked Python Typing #459 Inverted dependency trees #458 I will install Linux on your computer #457 Tapping into HTTP #456 You're so wrong #455 Gilded Python and Beyond #454 It's some form of Elvish #453 Python++ #452 pi py-day (or is it py pi-day?) #451 Databases are a Fad #450 At-Cost Agentic IDE Tooling #449 Suggestive Trove Classifiers #448 I'm Getting the BIOS Flavor #447 Going down a rat hole #446 State of Python 2025 #445 Auto-activate Python virtual environments for any project #444 Begone Python of Yore! #443 Patching Multiprocessing #442 Cloud bills in scientific notation #441 It's Michaels All the Way Down #440 Can't Register for VibeCon #439 That Astral Episode #438 Motivation time #437 Python Language Summit 2025 Highlights #436 Slow tests go last #435 Stop with .folders in my ~/ #434 Most of OpenAI’s tech stack runs on Python #433 Dev in the Arena #432 How To Fix Your Computer #431 Nerd Gas #430 Or you go to jail #429 Nitpicking Python #428 How old is your Python? #427 Rise of the Python Lord #426 Committing to Formatted Markdown #425 If You Were a Klingon Programmer #424 We Will Test in Production #423 Traveling the Python Universe #422 You need 4 spaces #421 22 years old #420 90% Done in 50% of the Available Time #419 Is your back end popular? #418 I'm a tea pot #417 Bugs hide from the light #416 A Ghostly Episode #415 Just put the fries in the bag bro #414 Because we are not monsters #413 python-build-standalone finds a home #412 Closing the loop #411 TLS Client: Hello <<guitar solo>> #410 Entering the Django core #409 We've moved to Hetzner write-up #408 python-preference only-managed 3.13t #407 Back to the future, destination 3.14 #406 What's on Django TV tonight? #405 Oh Really? #404 The Lost Episode #403 A machine learning algorithm walks into a bar… #402 How to monetize your blog #401 We must replace uWSGI with something else #400 Celebrating episode 400 #399 C will watch you in silence #398 Open source makes you rich? (and other myths) #397 So many PyCon videos #396 uv-ing your way to Python #395 pythont compatible packages #394 Python is easy now? #393 Dare enter the Bash dungeon? #392 The votes have been counted #391 A weak episode #390 Coding in a Castle #389 More OOP for Python? #388 Don't delete all the repos
Lots of Python style and Python 3000 is 3000 days old
Michael Kennedy (@mkennedy) · 2017-02-22 · via Python Bytes
Collapse transcript

00:00 This is Python Bytes, Python news and headlines delivered directly to your earbuds.

00:04 This is February 21st, 2017.

00:09 I'm Michael Kennedy here with my co-host, Brian Okken.

00:12 Hey, Brian, how's it going, man?

00:13 Going great.

00:14 We have some really cool stuff to talk about.

00:16 As usual, the Python ecosystem is bursting with good things to discuss.

00:21 Yeah, it definitely is.

00:22 So let's start with like a little reference book that we can use to stay on top of Python

00:27 and specifically modern Python, Python 3.

00:30 Yeah, so Matt Harrison has self-published quite a few books already.

00:34 And this one, I assume he self-published this one, but it's a tiny Python 3.6 notebook.

00:41 And he released it on GitHub and he also has a physical copy for sale on Amazon.

00:49 Anyway, I guess I'll just quote his introduction.

00:53 He said, this is not so much as an instructional manual, but rather notes, tables and examples

00:58 for Python syntax.

00:59 And I think it's pretty awesome.

01:02 It's like all of the syntax and everything boiled down into just the facts, ma'am, sort of thing.

01:10 It's like the pocket Python reference that you need, right?

01:13 Yeah.

01:14 And I like it even online, but it's one big long file.

01:19 I think he's got it priced at less than 10 bucks.

01:23 So I'm going to give it a shot and try the physical copy because I think that might be kind of a nice thing to have around.

01:28 Yeah, yeah.

01:28 Do you know if there's an e-book version?

01:30 Yeah, I think there is an e-book version.

01:32 Sweet, sweet, sweet.

01:34 My whole library loves on my Kindle.

01:35 If it's not on my Kindle, I don't know about it.

01:37 I love physical books, but I've done so much traveling for work that I just, I'm like, I can't take three books on this trip.

01:44 I'm just going to put them on my Kindle, you know?

01:45 So very cool.

01:47 And I know he does a lot of training and he said that he wrote this partly as something to give away when he does training.

01:54 And I think that's kind of a nice thing to hand people if you're going to do training is something like this.

02:00 Yeah, absolutely.

02:01 It's a perfect follow on to a training course or online course or something.

02:04 Okay, cool.

02:06 So the next one is by a friend of the show, Anthony Shaw.

02:09 And the title is, Oh no, this package is only Python 2.

02:14 It only supports Python 2.

02:15 The idea is like if you're like plowing through a project, doing some Python work,

02:20 and you hit a package that's not supported because it's only Python 2, he wrote up a nice little guide of like how to solve that problem and maybe solve it for the world and not just for yourself.

02:30 So he has like a 7.5 step guide here.

02:34 So first of all, check that nobody else has solved it.

02:37 An example of this might be if you go to say suds and check out the suds package,

02:42 which is like a soap client for Python.

02:44 It's only Python 2 is updated five years ago.

02:47 You could be like, Oh no, this doesn't work.

02:50 Well, there's another one someone else forked and created called suds dash jerko.

02:55 And that one is the Python 2 and 3 version.

02:58 So be sure to look around and like don't go through this effort if someone else is like a non, not very popular, but solved version.

03:05 So then he says, all right, what you're going to do is you're going to fork it first, like go and see if there's print statements that are statements and not functions.

03:11 Fix that, right?

03:13 Write some tests.

03:14 Hopefully tests exist.

03:15 But if they don't write some tests because, you know, just the fact that it runs isn't really good enough.

03:19 And it has some cool package dimensions called modernize.

03:23 Do you know this package, Brian?

03:23 I haven't used it, but I've heard of it.

03:25 Yeah.

03:25 This is not like modernizer from JavaScript.

03:28 This is something from Python to aid with the conversion.

03:32 So, yeah, it's very cool.

03:33 I haven't used it much myself either, but I'm going to check it out.

03:35 So thanks, Anthony, for pointing that one out.

03:37 He says, all right, update the setup UI to describe your new dependencies and stuff.

03:41 Install into your original project.

03:43 Raise a pull request.

03:44 And then sadly he says, okay, well, what happens when three months later your pull request is ignored?

03:50 How do you go about dealing with this?

03:51 And it turns out as a result of this article, the package that he wrote this article because this happened to him.

03:59 He's like, all right, I need this package.

04:00 And, oh, no, it's not supported on Python 3.

04:02 So he went through this and actually did the PR.

04:04 And he said, after he wrote this article, the author or maintainer of that package came along and quickly accepted the PR.

04:12 And now that thing is Python 3.

04:14 Okay.

04:14 So does he have any recommendations for what happens if nothing happens?

04:18 If nothing happens, he says, after a while, you know, you probably should do what the guy, the Jerko guy, that's his first name,

04:25 Jerko did with Suds is go and modify the setup PY, create a different package name, and just submit it to PyPI as like an alternate version or something.

04:39 If no one's going to fix the old one and he can't get control over it.

04:41 Yeah.

04:41 Interesting.

04:42 Yeah.

04:42 It's worth pointing out that the PyPI, the packaging authority group, they actually just, I think we maybe even discussed this on the show earlier in other episodes,

04:55 is that they came up with a way to like deal with this.

04:57 Like Suds is five years old.

04:59 It only supports, it's not been edited in five years.

05:02 Like surely that should be replaced by a modern version of it if there is one, right?

05:05 So that's cool.

05:07 Yeah.

05:07 I think we talked about it last time, right?

05:08 Yeah.

05:08 And it should be, and I'm glad they're taking that on because there should be a way to say, hey, I'm willing to be the new maintainer if nobody else wants this.

05:16 Absolutely.

05:17 Nice article.

05:18 And I like that this was discussed because that happens, I think that happens at least fairly regularly.

05:26 Well, and instead of just throwing up your hands, if a few people go through these steps on the popular packages, right, that solves it for the world.

05:33 It doesn't just, it solves it for the whole community.

05:35 It doesn't just solve it for your project.

05:37 So that's great.

05:37 Yeah, definitely.

05:38 And I think that maybe modernize might be a topic for some other week.

05:42 Yeah, absolutely.

05:43 Next, we've got another, I guess, another book-like thing.

05:47 It's not really a book, but there's somebody named Andrew Montalenti.

05:53 Why do I try to pronounce names?

05:56 Anyway, it's an article called Elements of Python Style.

06:00 And, of course, playing on the elements of, is it just elements of style?

06:04 Anyway, from writing.

06:06 But anyway, it takes, it's supposed to be more than PEP 8.

06:10 And it's an opinionated little fairly small style guide still.

06:16 It's not very huge.

06:17 Talking about basically some common, a good way to style.

06:21 I just like the format of it.

06:23 And I think that I was going to take this article, and it's on GitHub.

06:27 I was going to take it and fork it and try to make something for my own team.

06:30 Oh, yeah, that's cool.

06:31 I think these things are great.

06:33 And it certainly, certainly having a consistent style helps, like you say, for example, on your team.

06:39 And if you are, a lot of people listen to the show, they're looking for jobs, getting into programming, getting into Python, like study this kind of stuff, right?

06:46 If you show up for like an interview and they ask you to write some code and you write it JavaScript style, or you write C++ style, and you claim to know Python, they're going to look at you sideways and go, hmm, not so sure about that, you know?

06:57 Yeah.

06:58 So knowing these things is like the first step to fitting in, I guess.

07:03 You have one course on Pythonic stuff.

07:05 So what did you think of all of these recommendations here?

07:08 I think these were really good.

07:10 I didn't totally study every single one of them, but looking through it, it looked really good.

07:13 Like, for example, one of the pieces of guidance I really like says you can choose camel case.

07:18 So capital first letter, capital letters of every word for things that are not quite class-like, right?

07:26 So if you have a class, PEP 8 says that should be camel case.

07:30 But you also have other things like what about named tuples?

07:34 How should a named tuple be?

07:35 I mean, it's effectively a class that has no functions, just data.

07:40 But, you know, it seems like that.

07:42 So guidance like that, like he says, the main benefit of camel case is calling attention to something that's a global noun rather than a local label or a verb.

07:50 And like, for example, Python uses true, false, and none as camel case, even though they're not classes.

07:56 So, yeah, I think this is great.

07:57 I enjoyed the article.

07:58 Okay.

07:59 My next item for you is just a cool bit of trivia.

08:02 And I want to say thank you to Christian Klaus for sending this my way.

08:06 And I found, I was looking through Reddit for things for this episode and came across somebody had posted a tweet of mine,

08:15 which that's never happened to me before, that a tweet has been actually a topic on Reddit.

08:19 And one of this popularity, it had 537 upvotes and 71 comments on my tweet.

08:25 Anyway, why was that cool?

08:27 Why is that interesting?

08:28 It has nothing to do with me because I just carried the message from Klaus, basically.

08:31 And he says, Python 3, which was originally called Python 3000, right?

08:37 That's, it's actually from Pep 3000 is the original working title that it got.

08:43 And it was released December 3rd, 2008.

08:46 So last Sunday, February 19th, it was exactly 3000 days old.

08:52 Oh, cool.

08:53 Isn't that nice?

08:54 So we've come a long ways with Python 3.

08:57 And, you know, some people kind of treat it like it's new.

09:00 It's not new.

09:01 No, definitely not.

09:02 Definitely not.

09:03 But I think it's really cool that we just passed the day where Python 3000 is 3000 days old.

09:07 Actually, that's worthwhile trivia.

09:08 I like it.

09:09 Yeah, thanks.

09:09 So another thing that I really like is these resources or like sites that bring all these different information together.

09:18 Because I have people that ask me all the time, hey, Michael, I want to get started in programming.

09:21 What are the steps I should take?

09:23 Or I've gotten this far in Python.

09:25 What should I study next?

09:26 Should I go into databases?

09:27 Should I go into data science?

09:28 What else should I do, right?

09:30 Yeah.

09:30 So there's a couple of guys that are putting together.

09:33 Actually, they're putting together some interesting topics lately.

09:37 Bob Belderboss and Julian Sequeria.

09:40 I should have you do the names.

09:42 These are pretty interesting guys that have actually talked to us, sent out feedback to us about the show and other things.

09:50 But they put together a post called that it's Python Resources.

09:54 And it's called Python Books, videos and resources from beginner to pro.

09:59 We're going to link a Reddit thread that they put up and also the link to their post.

10:04 But it's actually, it's not huge.

10:06 That's one of the things I like about it.

10:08 It's not really big list.

10:09 But it's one of the things that does definitely has is it has some nice podcasts listed in the other resources.

10:15 Yeah, of course.

10:17 Of course.

10:17 It has like a nice getting started section.

10:19 It has a now that you've done fundamentals, how do you get better?

10:23 Additional resources, all sorts of stuff.

10:26 So a lot of different ways, you know, it's got like a Hitchhiker's Guide to Python, Fluent Python, Effective Python, a lot of stuff that I've covered on my podcast, which is really great.

10:35 Some online courses and thank you.

10:37 They've included mine in there, which is really cool.

10:39 But yeah, a bunch of stuff in here that you can check out.

10:42 Full Stack Python, which of course is excellent.

10:44 Their website is P-Y-B-I-T dot E-S, which is fairly clever and fairly similar to the name of our podcast.

10:53 It is quite similar.

10:55 It's not the same, but it is quite similar.

10:58 PyBytes.

10:58 And yeah, these guys, at least Bob is in Spain, I think.

11:02 So the E-S makes a lot of sense there.

11:05 That's very cool.

11:05 All right.

11:06 My last one is a Python tool that I think a lot of people will find very useful.

11:11 So it's called Mongo Audit and it's written in Python and it has like even a nice little GUI to it, which is pretty cool.

11:18 So it describes itself as a CLI or command line interface tool for auditing MongoDB servers,

11:24 using poor security settings and performing automatic or automated penetration testing.

11:29 So you can just pip install Mongo Audit and then run it against your Mongo servers.

11:33 All databases, you want them to be secure, right?

11:37 Like if a database is just accessible on the internet with no login, that's bad, right?

11:41 Yeah.

11:42 Especially if you have private stuff in it.

11:44 So I love MongoDB.

11:47 I'm on the MongoDB masters group and I've worked with MongoDB for a long, long time.

11:52 There's a couple of choices that MongoDB has made in the early days that have kind of harmed it in terms of getting it in the headlines in ways in which it shouldn't be.

12:02 And a couple of those are by default runs without authentication.

12:06 Of course, you can set a username and password, but if you don't take that action because you don't know better, well, then if it's listening on the open internet, that's really, really bad.

12:15 And so there's a number of things like make sure you run with SSL enabled, make sure you run with the authentication and so on and so on.

12:21 So this tool basically go and run all those tests against a set of MongoDB servers, right?

12:27 And it checks that it's running like see on a non-default port.

12:30 It only accepts connections from certain hosts and so on.

12:34 So this is really, really cool.

12:36 This is very cool.

12:37 And I'm putting together a tutorial with using Mongo and I'm not, haven't taken any classes in it and I don't know how to do any of this stuff.

12:45 So I'm glad that there's a tool like this so they can point out what problems I've had with my setup and maybe I can pick your brains as to what I wish to do next.

12:54 Yeah, yeah, absolutely.

12:55 I would say like at a minimum, you know, run this tool and it has a lot of great recommendations.

13:00 But certainly at a minimum, if you're, you know, make sure you're at least only listening on local loopback.

13:05 So 127.0.0.1 or you have SSL enabled and authentication enabled, right?

13:11 Like those are the two big ones, but this tool will catch like that and lots and lots more.

13:15 So if you're somehow in charge of MongoDB things, pip install Mongo audit and have a run at it.

13:24 Very cool.

13:24 Yeah, very cool.

13:25 All right.

13:26 That's it for the news this week.

13:27 Brian, anything else you want to share with everyone?

13:29 How's the book coming along?

13:31 You know, it's very exciting.

13:32 I've got, I think we're going to do total of, I can't remember, seven or eight chapters.

13:36 And I've got five that are, I've already gone through a second phase editing and getting at with, we're playing with book titles and playing with covers now.

13:45 So hopefully not too much longer before we can make an announcement.

13:48 How awesome.

13:49 And who's the publisher?

13:50 Pragmatic.

13:51 Pragmatic.

13:51 Awesome.

13:52 Do they do things like have special covers?

13:54 Do they have like characters on the covers or anything?

13:56 There are different pictures, of course, for every book, but they're, we're working with, I'm trying to convince them to not do another snake cover just because it's Python.

14:04 Absolutely.

14:05 No more snakes.

14:06 We can do more.

14:07 It's not even as, what's so funny is like, it's not even a snake as the origin, right?

14:11 It's Monty Python.

14:12 I was thinking maybe a large tree, but that might not go over well.

14:16 What about the rabbit?

14:18 You know, the rabbit with the grenades?

14:19 Oh yeah.

14:20 That'd be funny.

14:21 The killer rabbit.

14:22 Killer rabbit.

14:23 Maybe it won't sell too many tech books.

14:25 I think it'd be funny.

14:26 Well, you have some, you have some news, Michael.

14:29 I do.

14:29 Just this morning, I released my latest course at bit.ly.

14:34 So bit.ly slash Python dash rest dash course.

14:38 So I created a course that is consuming HTTP and restful services.

14:43 JSON, XML, SOAP, binary data, screen scraping, all that kind of stuff.

14:47 So if that's interesting to you, check out this course.

14:49 And the next one I'm working on is the anti-matter version of this course, creating

14:55 services so that other people can consume them.

14:58 Oh, nice.

14:58 Yeah.

14:58 So I'm kind of on a services trip these last few weeks.

15:01 Cool.

15:01 Yeah.

15:01 Yeah.

15:02 All right.

15:03 Well, thanks for getting together today, Brian, and talking about all the stuff.

15:06 Yeah.

15:07 Thank you.

15:07 Very interesting stuff.

15:08 I love all the books and the references and the guidance.

15:11 Yeah.

15:11 All right.

15:11 Catch you later.

15:12 Bye everyone.

15:12 Bye.

15:13 Thank you for listening to Python Bytes.

15:16 Follow the show on Twitter via at Python Bytes.

15:18 That's Python Bytes as in B-Y-T-E-S.

15:21 And get the full show notes at pythonbytes.fm.

15:25 If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

15:29 We're always on the lookout for sharing something cool.

15:32 On behalf of myself and Brian Okken, this is Michael Kennedy.

15:35 Thank you for listening and sharing this podcast with your friends and colleagues.