1 hour ago · Tech · hide · 0 comments

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. If you write any Python code, you should be using more namedtuples than you are using right now. They are my favourite data structure in Python: they are a subclass of tuples so they are immutable but in addition, you give them and their fields names which increases the readability and debuggability of your code a lot. I have raved about them before: in Batteries included in 2024 as well as every year when writing about Advent of Code. You should read the earlier post for more reasons for why to use them. For the second time this month, I’ll link to Raymond Hettinger’s great talks, this time to his Beyond PEP 8 talk from PyCon 2015 where in addition to a bunch of other good tips, briefly talks about why…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.