My program requires user to provide their own implementation of certain functions (say foo). In compiled languages like java or C, I would declare foo as an interface, compile the rest of my code as a library, and ship the library to the user. The user would then link their implementation with my library to generate the final executable.
What would be the python equivalent of doing the above? As the user do I copy all the python code into a separate folder, add my implementation of foo to that folder, then run? And if I have multiple implementations of foo then do I clone that folder multiple times and replace with different foos? That sounds cumbersome / problematic in case I need to modify some of the library code myself, then I'll end up with multiple clones that are out of sync.