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, coefficients): self.coefficients = coefficients for polynomials of the form p(x) = a_0 + a_1*x + a_2*x^2 + ... + a_n*x^n where the list coefficients = (a_0, a_1, ..., a_n) stores those coefficients. One plugin-module horner could then provide a function horner.evaluate_polynomial(p, x) to evaluate a Polynomial instance p at value x , i.e. return the value of p(x) . But instead of calling the function that