99 days ago · Tech · hide · Fediverse post

Python A-Z is a blog series about Python. Each day, I share insights, ideas and examples for different parts of Python development that match with the letter of the day. Blaugust is an annual blogging festival in August where the goal is to write a blog post every day of the month. In PyCon US 2013, Raymond Hettinger talked about writing beautiful, idiomatic Python. It’s a great talk but for this post, I’ll focus on what he talks about around 30 minute mark. He shares an example (which dates the talk and example nicely; those were the times) twitter_search('@obama', False, 20, True) We spend way more time reading code than we do writing it. While modern code editors and IDEs give you a lot of help (as you can see in the following screenshot from VS Code), it’s still an extra step. Keyword arguments are a great, small step to improving the readability of your code. Compare the two: twitter_search('@obama', False, 20, True) # and twitter_search('@obama', retweets=False, numtweets=20,…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town