Monkey-patching a new method to an object

Run Settings
LanguagePython
Language Version
Run Command
import types class MyClass(object): def __init__(self, value): self.value = value c = MyClass(42) def print_value(self): print(self.value) c.print_value = types.MethodType(print_value, c) c.print_value()
Editor Settings
Theme
Key bindings
Full width
Lines