Apr-13-2017, 07:54 PM
i wanted a PointerVariable Class. but many problems came out. i want to understand what i want with following code.
class PointerVariable() def __init__(self, val = None): self.val = val def for_use_of_variable_without_calling(self): # this function runs only when variable is used without calling return self.val # __repr__ function only returns string so i don't want use it def new_value(self, val): # this function for use of "myPointerVariable = 234" expressions self.val = val # example: "myPointerVariable = 234" expression is run the this function as self.new_value(234) example = PointerVariable("foo") example = "bar" # this expression is run the new_value functiıon as self.new_value("bar") example # this expression is run for_use_of_variable_Without_calling_event function as with no argsis there a any magic method for do this instead of my exapmle functions