Overriding a class that does not get explicitly called

Viewed 54

My app consists of one python file entry_point.py and makes a heavy use of the installed packages. I need to override the behaviour of one of the classes—say ClassA (which resides in one of the installed packages) with ClassB. ClassA does not get explicitly called in my entry_point.py.

Initially I tried defining ClassB in my entry_point.py and then doing something along the

path.to.the.package.with.ClassA = ClassB

lines in entry_point.py, but it did not work (because, I assume other files inside of the isntalled packages still refer to the original ClassA in their import statements).

Does anyone have an idea of how this could be done?

0 Answers
Related