I would much prefer a name like `from_dict` instead of `factory` -- it makes it clearer what the classmethod is expecting for an argument, and means that you can write multiple different factories that accept different kinds of arguments without it being confusing.