Code organization in Python: Where is a good place to put obscure methods?
Question: I have a class called `Path` for which there are defined about 10 methods, in
a dedicated module `Path.py`. Recently I had a need to write 5 more methods
for `Path`, however these new methods are quite obscure and technical and 90%
of the time they are irrelevant.

Where would be a good place to put them so their context is clear? Of course I
can just put them with the class definition, but I don't like that because I
like to keep the important things separate from the obscure things.

Currently I have these methods as functions that are defined in a separate
module, just to keep things separate, but it would be better to have them as
bound methods. (Currently they take the `Path` instance as an explicit
parameter.)

Does anyone have a suggestion?


Answer: If the method is relevant to the Path - no matter how obscure - I think it
should reside within the class itself.

If you have multiple places where you have path-related functionality, it
leads to problems. For example, if you want to check if some functionality
already exists, how will a new programmer know to check the other, less
obvious places?

I think a good practice might be to order functions by importance. As you may
have heard, some suggest putting public members of classes first, and
private/protected ones after. You could consider putting the common methods in
your class higher than the obscure ones.

