Defines a @property dynamically for an instance rather than a class.

def define_property(obj, name, fget=None, fset=None, fdel=None, doc=None):
    """Defines a @property dynamically for an instance rather than a class."""
    if hasattr(fget, '__get__'):  # can pass a property declaration too
        prop = fget
    else:
        prop = property(fget, fset, fdel, doc)
    cls = obj.__class__
    obj.__class__ = type(cls.__name__, (cls, ), {
        '__doc__': cls.__doc__,
        name: prop
    })