Using Python types for fun and profit: the Visitor Pattern

Introduction The visitor pattern is a design pattern that allows for adding new operations to a collection of objects, without, and that is important, modifying the objects themselves. It looks like this: There are two main functionalities: Implementation in Python…


