May-10-2017, 12:11 AM
my question here
how can i change readonly variable. this soo nonsense ):
my code
how can i change readonly variable. this soo nonsense ):
my code
example = {"book": "Guliver", "game": "Age of Empires II"} def __getitem__(self, key): if key == "game": print("Dont play game go to bed") elif key == "book": print("good choice") return dict.__getitem__(self, key) example.__getitem__ = __getitem__ # giving error. how can i fix ?