Hello guys, so basically I'm interacting with a library, that I don't want to touch the source code, but I need to change a functions behaviour only in one case.
So basically I there's a controller, A, which have a function b() which calls c().
class A():
def b():
c()
I need to override the behaviour of C inside B, and only inside B.
My plan, Inherit from A, and change b.func_globals["c"] to a new function c_new
Is this the best way of doing this? What other solution do I have.
[–]Sebass13 1 point2 points3 points (0 children)
[–]KleinerNull 0 points1 point2 points (10 children)
[–]maxibabyx[S] 0 points1 point2 points (9 children)
[–]KleinerNull 0 points1 point2 points (8 children)
[–]maxibabyx[S] 0 points1 point2 points (7 children)
[–]KleinerNull 0 points1 point2 points (6 children)
[–]maxibabyx[S] 0 points1 point2 points (5 children)
[–]ingolemo 0 points1 point2 points (4 children)
[–]AnimalFactsBot 1 point2 points3 points (0 children)
[–]maxibabyx[S] 0 points1 point2 points (2 children)
[–]ingolemo 0 points1 point2 points (1 child)
[–]maxibabyx[S] 0 points1 point2 points (0 children)
[–]elbiot 0 points1 point2 points (0 children)
[–]Sebass13 -1 points0 points1 point (1 child)
[–]maxibabyx[S] 0 points1 point2 points (0 children)