Refactoring in Python

Design patterns and approaches.


A talk describing experiences and lessons learned from tackling extremely demanding code. How to bring order to mismanaged code and elevate the code base to a standard that's acceptable in today's tech environment.

Python makes wonderful code accessible at our fingertips, but it also allows us to take a lot of liberty. When you start, code is beautiful and makes sense. With each step you walk on, you find more and more hacks showing up. Eventually, the brilliant codebase you've started with can not be seen under the mud.

Not every code-base can be rewritten, not everything can be redone from scratch. Cool libraries often take a lot of liberty with code structure and make cross-integration difficult, if not impossible. Tests sound ideal, but in practice, they're just so hard to make right. Why is this, and how to change it?

The talk will tackle the problems in three parts:

The talk closes with audience discussion and experiences, questions and proposals - building a collection of some on-premise tips and tricks.


Branded with, which has provided me with time and opportunity to make this talk and present it several times over. youtube_link: youtube_comment: One of first versions of this talk, at a Moscow conference.

PDF icon Download the presentation in PDF format


One of first versions of this talk, at a Moscow conference.