def TypedList(type_): """A helper to generate an attribute which would be with list factory but also defining a type in its metadata """ return attr.ib(default=Factory(list), metadata={'type': type_}) # # Models #