Using tests inputs in assertions (or rather not)

Posted on 10 November 2021 in articles • Tagged with programming, python, testing, unit tests

beautiful [but deadly] square knot / by woodleywonderworks / https://www.flickr.com/photos/wwworks/5623339500 / License: Attribution 2.0 Generic (CC BY 2.0)

It might be very convenient to use the same fixtures in test setup and assertions. This practice though is not as good as it looks like at first glance.


Continue reading

Hexagonal architecture of ports and adapters, Dependency injection and Python - Part I

Posted on 30 October 2021 in articles • Tagged with architecture, DDD, dependency injection, hexagonal architecture, programming, python

Welcome to a short series of articles which cover principles of Hexagonal architecture, talks of Dependency Injection, and applies these all to Python and Django application design.


Continue reading

Concrete Settings: a new way to manage configurations in Python projects

Posted on 11 July 2020 in articles • Tagged with programming, library, python, concrete settings

After two years of developing a hobby project, I am proud to announce Concrete Settings - a new configuration management library for Python projects.

Concrete Settings was born as an effort to improve configuration handling in a huge decade-old Django application with exceedingly bloated settings.py. Remember that settings.py starts …


Continue reading

The ultimate guide to Python decorators

Posted on 22 January 2017 in articles • Tagged with Python, programming

Decorators are one of the most beautiful feature of Python programming language. They can make code easy-readable and maintainable. Nevertheless, their usage may seem tricky and mysterious in the beginning. This is a guide to the world of decorators. I hope that you will feel like a pro and have no questions left about them after exploring this article.


Continue reading

Python nightmares: Implicit this

Posted on 11 May 2015 in articles • Tagged with Python, programming

I met a lot of Python beginners who complained about this keyword not implicitly available in class methods. After all, why pass self explicitly?


Continue reading

A micro Lisp interpreter experiment

Posted on 21 June 2014 in articles • Tagged with Python, Lisp, programming

While reading the Binary trees chapter from Programming Interviews Exposed by John Mongan et al. I started thinking of alternative recursion examples which do not involve sorting, generating Fibonacci sequence, binary tree traversal and similar tasks. Lisp! Lisp is inseparable from recursion and Lisp interpreter would be a good case to demonstrate what recursion is and how it can be used efficiently. What would be a minimal simplified Lisp interpreter written in Python? Surprisingly, I managed to do it just in 6 lines of Python code! And this is not just because of Python being a wonderful language, but because of Lisp being such a beautiful and simple concept.


Continue reading

Kidomi - a JSON-based templating library

Posted on 05 January 2014 in articles • Tagged with CoffeeScript, JavaScript, programming

kidomi - is a simple yet powerful javascript templating library which converts JSON input into a certain DOMNode output. Kidomi was written after I have had a chance to try the dommy ClojureScript library in production.


Continue reading

Is it a string?

Posted on 23 September 2013 in articles • Tagged with JavaScript, programming

How do you know if a Javascript variable is actually a string? There are several ways to answer this simple question.


Continue reading

Kaylee v0.3

Posted on 20 June 2013 in articles • Tagged with Kaylee, Python, programming

Ladies and Gentlemen! I am proud to announce that Kaylee v0.3 has been finally released!


Continue reading

PyRegs: The Python Regex Debugger

Posted on 22 May 2013 in articles • Tagged with programming, Python

Long ago, I learned the regular expressions in order to write a simple syntax highlighting engine. Regular expressions are not hard to master, but take time to practice. Kodos was the regex debugger of my choice, as it was written in Python. All these years Kodos was a "must have" tool on my development machines. Suddenly with the new version of Debian operating system, Kodos was not in the repositories anymore! Why? Kodos is based on QT3 widgets toolkit, which is a bit outdated nowadays (QT5 has been released recently) and was removed from Debian 7.0 ("Wheezy"). That is how I decided to write a small Python regex debugger in Python 3 and its de-facto standard Tkinter bindings to the Tk GUI toolkit.


Continue reading