What is monkey patching?

前端 未结 8 2035
[愿得一人]
[愿得一人] 2020-11-21 16:35

I am trying to understand, what is monkey patching or a monkey patch?

Is that something like methods/operators overloading or delegating?

Does it have anyt

8条回答
  •  长情又很酷
    2020-11-21 17:20

    Monkey patching is reopening the existing classes or methods in class at runtime and changing the behavior, which should be used cautiously, or you should use it only when you really need to.

    As Python is a dynamic programming language, Classes are mutable so you can reopen them and modify or even replace them.

提交回复
热议问题