One of the provisions in the camp for what you are probably really going to use is calling the __setattr__ method for the class.
This method is executed when an attribute that usually does not exist is in the instance:
>>> class Test(object): ... a = 0 ... def __getattr__(self, attr): ... return attr ... >>> t = Test() >>> ta 0 >>> tb 'b' >>> tc 'c'
What you directly ask is also possible, but requires some hacks - which, although not recommended by common sense, is widely used in production in the wild. Namely, in order for the property to exist in Python, it is a class attribute for a special type of object that has at least the __get__ method. (to learn more about the "Descriptor Protocol" in Python docs).
Now, trying to create several properties at once, for example, the code inserted into the example will require that property names be entered into the class namespace from the called function. It is possible, and even used in production in Python, and not even difficult to achieve. But not really, nonetheless.
Thus, a possible way to avoid this is to make a call that returns a sequence of โpropertyโ objects - clean, readable, and customizable:
class MultiProperty(object): def __init__(self, getter, setter, name): self.getter = getter self.setter = setter self.name = name def __get__(self, instance, owner): return self.getter(instance, self.name) def __set__(self, instance, value): return self.setter(instance, self.name, value) def multi_property(mgetter, msetter, *args): props = [] for name in args: props.append(MultiProperty(mgetter, msetter, name)) return props class Test(object): def multi_getter(self, attr_name):