For some reason I have a class with a python getter acting like a setter...I have no idea why this is happening. If anyone could help me that would be much appriciated. :) This is my code
class Testclass():
def __init__(self):
self._testvar = None
@property
def testvar(self):
return self._testvar
@testvar.setter
def testvar(self, value):
assert False
testObj = Testclass()
testObj.testvar = "test"
print (testObj.testvar)
for some reason when I run the program it prints "test" but I am wanting it to print "None" or maybe even throw an error when I use
testobj.testvar = "test"