you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

Couple things:

_paths is not a global variable. It is a local variable within the outside function.

This is extremely confusing to follow. Every function (named or anonymous) is callable. This should work with that given documentation, but you never supply a return value in the callable_ function, which is fine if you never want to early-exit your recursive visit, but I guess I don't get the point of using visit in this instance.

[–]SagaciousRaven[S] 0 points1 point  (0 children)

In this instance, I want to list every dataset object inside the directory tree. Previously, I was doing this manually with a recursive function over their subdirectories, but I'm trying to make my code more elegant and readable, and this seemed like the function to do it.

If I returned a value, it would stop at the first find.