Breadcrumbs Collector

Acquiring knowledge one crumb at a time

The Clean Architecture in Python. How to write testable and flexible code

Sticky post

An ideal project? If someone asked about the features of an ideal project, responses would surely mention a few specific things. First of all, an ideal project would have a clean codebase that is simple to read. Secondly, there should… Continue Reading →

What is Celery beat and how to use it – part 2, patterns and caveats

Celery beat is a nice Celery’s add-on for automatic scheduling periodic tasks (e.g. every hour). For more basic information, see part 1 – What is Celery beat and how to use it. In this part, we’re gonna talk about common… Continue Reading →

When to use the Clean Architecture?

Enthusiasm, doubt, opposition There are few possible reactions after learning about the Clean Architecture or Hexagonal Architecture (AKA Ports & Adapters) or even merely innocent service layer in Django. Some developers are enthusiastic and try to apply these techniques immediately,… Continue Reading →

How to mock in Python? – (almost) definitive guide

What is a mock? Mock is a category of so-called test doubles – objects that mimic the behaviour of other objects. They are meant to be used in tests to replace real implementation that for some reason cannot be used… Continue Reading →

mypy: how to use it in my project? Part 3: kick-ass tools that leverage type annotations

Type annotations are a formalized way to add some extra information about types to your project. Once you get through adding mypy to your project and annotate your code (remember you can do it automatically, at least to some extent)… Continue Reading →

mypy: how to use it in my project? Part 2: automatically annotate code

Even after successful integration of mypy with an existing project (see mypy: how to use it in my project part 1), there are tons of code that does not have type annotations. Adding them manually is an unimaginable amount of… Continue Reading →

mypy: how to use it in my project?

Type annotations are like comments Type annotations are a great addition to Python. Thanks to them, finally our IDEs are able to provide good quality autocompletion. They did not turn Python into statically typed language, though. If you put a… Continue Reading →

Code review: how experienced developers do it?

High-quality code review is one of the secrets of the most effective teams. Over the years I noticed a few interesting ways to approach it. Now I share them with you in this article. Recipe 1: Suggesting refactoring in the… Continue Reading →

Implementing the Clean Architecture with Python – my book is here!

It is my pleasure to announce that my book is finally available to buy. 🙂 The books focuses on practical aspects and is illustrated with tons of code snippets in Python. Don’t forget to check out a code repository… Continue Reading →

What is asyncio’s ensure_future?

tl;dr ensure_future let’s us execute a coroutine in the background, without explicitly waiting for it to finish. If we need, we can wait for it later or poll for result. In other words, this is a way of executing code in asyncio without await.

« Older posts

© 2020 Breadcrumbs Collector — Powered by WordPress

Theme by Anders NorenUp ↑