This should probably be a generic function, rather than a class method: it doesn't need to know about `self` at all.