How can I make an alias to a non-function member attribute in a Python class?
I'm in the midst of writing a Python Library API and I often run into the scenario where my users want multiple different names for the same functions and variables. If I have a Python class with the function foo() and I want to make an alias to it called bar() , that's super easy: class Dummy(object): def __init__(self): pass def foo(self): pass bar = foo Now I can do this with no problem: d = Dummy() d.foo() d.bar() What I'm wondering is what is the best way to do this with a class attribute that is a regular variable (e.g. a string) rather than a function? If I had this piece of code: d =