On 10/5/22 3:32 PM, Daniel Castro wrote:
In this case I’m not doing anything too fancy: my use case is I have a main project script where I declare functions that can get executed independently with some prefix: e.g. ``x.build()``, ``x.test()`` so I can call ``myscript test`` or ``myscript build`` by parsing all x.* functions, and sometimes I have functions within them just for clarity since they’re just some abstraction for that particular function logic.

I parse these x function's comments as well to show in ``--help`` and therefore happened to notice the bug. The workaround for me is to simply move them outside the top level function, but I don't know if it would get in the way for some people doing more convoluted stuff with functions.

That's why I was asking -- there's no such thing as a local function, but I
can see wanting to declare a set of functions only if the `main' function
gets declared as an abstraction technique. Other than that, there's no
advantage.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/


Reply via email to