I am looking at changing the behavior of some third-party Python codes. There are many classes derived from the base class, and in order to easily achieve my goal, it would be easiest to override the base class used to get all the other classes. Is there an easy way to do this without having to touch any third code? In case I could not clearly explain this:
class Base(object): '...' class One(Base) '...' class Two(Base) '...'
... I would like to make changes to Base without actually changing the above code. Perhaps something like:
# ...code to modify Base somehow... import third_party_code # ...my own code
Python may have a great built-in solution to this problem, but I still don't know about it.
source share