Pattern: factory method, Python flavour