Have you ever seen the typing.overload decorator in the wild and wondered what it's actually for?

I wrote a short blog post explaining the problem it solves and how to use it in practice. 🐍

https://borutzki.github.io/2026/02/07/how-to-use-overloaded-signatures-in-python.html

#Python #programming #DailyPythonista

Debugger is fun and stuff but sometimes it's just faster to dump Django ORM data to a JSON, skim through it, apply fixes and forget about the topic.

Here's how to do that programmatically, e.g. during TestCase execution.

#Django #Python #programming #DailyPythonista #TDD

https://borutzki.github.io/2026/01/25/how-to-dump-django-orm-data-to-json-while-debugging.html

What if I told you that the following way of taking the second object from a Django `QuerySet` might be unreliable and can lead to non-deterministic failures under some circumstances?

And if you think it's a bad idea whatsoever - can you explain why?

Take a look on my recent blog post for more details: https://borutzki.github.io/2026/01/19/why-using-n-on-a-django-queryset-can-be-unsafe.html

#Django #Python #DailyPythonista #programming #ORM

Out of nowhere I decided to describe briefly my approach to reuse model_validator (and any other validator) across multiple #Pydantic models.

Code snippet from image should do the job, full context is in the linked blog post.

https://borutzki.github.io/2025/12/22/how-to-reuse-pydantic-model_validator-across-multiple-models-without-boilerplate-code.html

#Python #DailyPythonista #programming

Ever needed to check for root / admin privileges to make sure your Python script can work correctly?

In my last blog post, I provide you with approach for Linux, macOS and Windows to get this stuff done.

Happy hacking 🐍

#DailyPythonista #Python #programming
https://borutzki.github.io/2025/10/16/how-to-check-whether-python-script-has-elevated-privileges.html

How to check whether Python script has elevated privileges?

It may happen that a Python script needs root privileges on Linux / macOS or admin privileges on Windows to run properly. If it does not have them, there is no point in continuing. Let’s see how to quickly check whether the current runtime has those privileges.

Borutzki

Writing a technical article - even very subjective one - is quite a lot of work, if one wants to cover the topic well and at the same point not write a book on it in one go.

Just wanted to say that after a writing session.

Used a bunch of guard clauses (https://refactoring.guru/pl/replace-nested-conditional-with-guard-clauses) in text to state what the article is NOT about, to not waste my readers' computing power on reading something they're not interested in πŸ˜…

Still, it's work in progress. Until next time!
#DailyPythonista

Replace Nested Conditional with Guard Clauses

Problem: You have a group of nested conditionals and it’s hard to determine the normal flow of code execution. Solution: Isolate all special checks and edge cases into separate clauses and place them before the main checks. Ideally, you should have a β€œflat” list of conditionals, one after the other.

Finally, started working on a separate blog dedicated to technical stuff like #Python, #Django, #Pydantic, #GitLab, #Docker, #RobotFramework and so on.

In this first post I introduce myself and the purpose of the blog, then proceed to a bunch of quick examples of printing "hello world" in Python.

Even if you're not interested - come and see how to add padding to printed string in Python 🐍

#DailyPythonista

https://borutzki.github.io/2025/10/03/hello-world.html

print(β€œHello World!”)

Coding for people, not just processors. Pragmatic solutions for non-trivial problems.

Borutzki

Finished reading "Working Effectively with Legacy Code" by Michael Feathers.

Even though some information from the book was useful, I feel like techniques proposed there don't stand up to current test frameworks with mocking systems.

Hence, most of the tips are not relevant in #Python world.

I liked though was the angle author took on encapsulation and component boundaries, though.

Have you read the book? What did you like (or not) about it?

#DailyPythonista #coding #programming #bookstodon

If you want to hear me talking about bad #RobotFramework practices and how to mitigate their outcomes, sign up for #Wrobocon conference happening October 23rd πŸ€–

Image below comes from the official announcement from LinkedIn, hopefully no one will get angry for posting it here 😬

Conference web page: https://wrobocon.eu/
LinkedIn announcement: https://www.linkedin.com/posts/wrobocon2025_speaker-announcement-python-activity-7363941414872756224-6VN1

#DailyPythonista #Python #TestAutomation