0
problem in Python property setter/getter
2 Réponses
+ 8
From line 19 pineapple_allowed which contains *False* is attempted to changed using setter decorator. The new def function has another argument as "value". This parameter corresponds to the return value of pineapple_allowed.
Next we have statement: 'if value:' which has the boolean*false*(because value = False) , therefore it never executes.
This concludes that setter function never executes because at starting it was False. So the values for pineapple_allowed will not be determined by setter.
This whole thing is bit complex to explain. I suggest you to take help from external websites about setter/getter.
+ 1
what is the problem actually