Sometimes when I'm working in a large package, I'll find that there's behavior that's very difficult to work around in one of the dependencies, and sometimes the only way to implement a solution and move on is to alter a module in the dependency and wait for a fix or a new feature from the developers. Just to make this more concrete, imagine the workaround is in matplotlib.legend.py. Here's where how my project might be packaged:
myproject
bundled
legend.py
a.py
b.py
c.py
And until a new version of matplotlib is released that fixes some bug or implements some feature, I just make calls like:
from bundled.legend import X,Y,Z
Obviously this works sometimes, but often I have to bundle several modules to get the behavior.
Sometimes doing this is the only way I can move forward on a project, but I don't know how other engineers would react to this practice. Is this an acceptable practice in python
? A lot of times it's not just workarounds that motivate this, but customization or adding some features particular to myproject
that are deep into the module.