Share

Bite-Sized Python News & Updates

After last week's Julian beach photo, here is a view that inspires Bob to get more dev tips in 😎

Dive into some Python Tips

Hey Pythonista,


Welcome back to our weekly newsletter. What do you think of our new format? Reply and let us know!


Here are a couple of Python | developer | Pybites nuggets, enjoy!


1) Not all duplicated code is bad. 💡


I’m a strong advocate for DRY (don’t repeat yourself) in my code and when reviewing others'.

However, while reading 99 Bottles of OOP (by Sandi Metz and Katrina Owen), I came across an elegant counterexample.

It embraced a bit of duplication (via match/case) but significantly improved:

  • Simplicity

  • Readability

  • Maintainability

It reminded me that in software, few rules are absolute. The right choice often depends on the codebase and its context.

Above all, prioritize simplicity and think about how easy it will be to adapt or extend your code in the future. 🚀



2) uv 😍 📈


Did you know you can easily try the free-threading Python 3.13 version using `uv run --python 3.13t`


Or what about trying out the latest Python 3.14 alpha? You can use: `uv python install 3.14 --preview`


Curious to hear who is not yet using uv?


Hear more from the creator of uv about what went into building this amazing tool



3) To walrus or not to walrus?


`:=` was introduced in 3.8 and it's a feature that can lead to very concise code, but also overly convoluted code.


A feature to hate to love, love to hate? I came across two nice use cases I shared on LinkedIn.


Check them out and join the discussion here: https://www.linkedin.com/feed/update/urn%3Ali%3Aactivity%3A7273287302854950913/



4) functools, another awesome Python Standard Library module 💎


Unlock the power of Python with the functools module and write more efficient, readable, and maintainable code 🤩


  • Ever heard of caching? Use the @cache decorator to speed up your computations. 🚀

  • Simplify your code with less dunder methods! @total_ordering can automate class comparisons, reducing boilerplate code. 📈

  • Freeze a part of your function using partial() creating 'reusable components'. 🎉

  • Handle multiple data types gracefully with @singledispatch for generic functions. 💡

  • Preserve function metadata while creating decorators is important. functools.wraps() has you covered. 🤝

  • Aggregate data smartly using reduce() for powerful data transformations.

Full article: https://pybit.es/articles/6-cool-things-you-can-do-with-the-functools-module/



5) The Pybites Platform now has tips!


We've written an incredible number of tips over the years which we've now integrated into the new Pybites Platform. And yes, they're categorised!


You can check these out, along with our 400+ Python exercises using the following link (must be logged in).


Check out the new Pybites Platform

Help shape our podcast this year

The Pybites Podcast is one of the most exciting things we get to do, and we're humbled by all the positive feedback we've received over the years.


We want to keep the quality up and make sure it benefits you the most. Therefor we made a quick 1-minute form to get your inputs - thanks!


Have Your Say

Refactoring video

In this refactoring video I take a simple function that has 5 arguments and refactor it down to 1 argument using a dataclass (and later a named tuple).

This encapsulation into an object leads to better organized and more readable code.


While you watch, remember to Subscribe! We have a whole mess of videos planned for 2025 that you won't want to miss 😄


Watch on YouTube

"Code is like humor. When you have to explain it, it’s bad." - Cory House


\n\n\n\n

Email Marketing by ActiveCampaign