Skip to content Skip to sidebar Skip to footer
Showing posts with the label Monkeypatching

How To Dynamically Set An Object's Method At Runtime (when The Object Is An Instance Of A Gym Environment)?

I want to override an instance's method. Let's call this instance/object env. The instance … Read more How To Dynamically Set An Object's Method At Runtime (when The Object Is An Instance Of A Gym Environment)?

Dynamically Set An Instance Property / Memoized Attribute In Python?

I have an existing example class in Python 2.7x class Example(object): a = None b = None … Read more Dynamically Set An Instance Property / Memoized Attribute In Python?

Should A Plugin Adding New Instance-methods Monkey-patch Or Subclass/mixin And Replace The Parent?

As a simple example take a class Polynomial class Polynomial(object): def __init__(self, coeff… Read more Should A Plugin Adding New Instance-methods Monkey-patch Or Subclass/mixin And Replace The Parent?