Working with a path-based resource system, the application needs to find the first working resource that manages a given resource based on paths. I need a succinct, pythonic way to generate the following:
Input:
/house/dogs/ralph/boneOutput:
/house/dogs/ralph/bone/house/dogs/ralph/house/dogs/houseNote: It's okay to use os.path or similar built-ins, but these are not filesystem resources. Output can be anything iterable (list, set, generator, etc.).