Serge Aurubin

SERGE AURUBIN

SR. AI CLOUD ENGINEER

Welcome to my blog for everything having to do with data science and analysis. I am always looking for new opportunities to drive business insight using data analysis.

Data & Analytics
  • Data Analysis
  • Power BI
  • Excel
  • Data Pipelines
  • Matillion
Engineering
  • Software Developer
  • Python
  • PHP
  • ReactJS
  • Flutter
  • Front End Dev
  • Back End Dev
Databases
  • MySQL Dev/DBA
  • Oracle DBA
Cloud & AI
  • Amazon Web Services
  • Docker
  • Kubernetes
  • Git
  • Artificial Intelligence
  • Claude
  • OpenAI
Back to Videos

The Visitor Pattern in Python (And Better Alternatives)

ArjanCodes

October 23, 2026   20

???? Learn how to design great software in 7 steps: https://arjan.codes/designguide.

The Visitor pattern has a reputation for being complicated, but the problem it solves is actually quite simple: what happens when you keep adding new operations to the same set of objects?

In this video, I use a document editor to compare several ways to solve that problem: methods, pattern matching, the classic Visitor pattern, a dispatch matrix, and Python’s `singledispatch`. More importantly, we’ll look at the trade-offs of each approach and when Visitor is actually worth using.

???? GitHub Repository: https://git.arjan.codes/2026/visitor.

???? Join my Discord server: https://discord.arjan.codes.

⌨️ Keyboard I’m using: https://amzn.to/49YM97v.

???? Chapters:
0:00 Intro
1:23 Methods on the Nodes
2:41 Pattern Matching Groups Code by Operation
3:53 Classic Visitor
6:23 The Design Problem
7:06 The Dispatch Matrix Underneath Visitor
9:35 Let Python Maintain the Matrix
11:46 Final Thoughts

#arjancodes #softwaredesign #python

0 Comments

No comments yet. Be the first to weigh in.

Back to Videos

Login