def constant(func):
    """
        Decorator that prevents a value from being changed.
        Represents a constant as best as possible.
    """
    def fset(self, value):
        raise TypeError("Constant - no setting!")

    def fget(self):
        return func(self)
    return property(fget, fset)