This code does not modify the behaviour of the instance of the BN_Metamodel_easy. In fact, it does not have any effect at all, I believe.
class BN_Metamodel_easy:
def changeNumBinsDict (dict):
BN_Metamodel_easy.numBinsDict = dict
Suggested solution
Here, we change the instance of the class that has been instantiated. (I have also fixed the keyword argument dict so that it follows readability convention.)
class BN_Metamodel_easy:
def changeNumBinsDict (self, bins):
self.numBinsDict = bins
Tested
class Test:
def __init__(self, val=1):
self.val = val
def change_value(self, val):
Test.val = val
Implementation:
test = Test()
print(test.val)
test.change_value(5)
print(test.val)
test = Test()
print(test.val)
This code does not modify the behaviour of the instance of the BN_Metamodel_easy. In fact, it does not have any effect at all, I believe.
Suggested solution
Here, we change the instance of the class that has been instantiated. (I have also fixed the keyword argument
dict
so that it follows readability convention.)Tested
Implementation:
Result: