Posts: 4,647
Threads: 1,494
Joined: Sep 2016
i am adding a reverse=False|True feature to my file tree recurse generator. my question is this: when reverse is true, should directory names be yielded before descending into that directory
or after (when ascending back up)?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
(Aug-02-2021, 04:41 AM)Gribouillis Wrote: You could have another option with values "prefix"|"infix"|"postfix"
with what semantics? i was thinking:
descend=True|False and
ascend=False|True where they indicate a directory name is or is not yielded at that particular event for every directory descended into (not for those matching
exclude= when i implement that).
when i specify
reverse=True and
descend=True and
ascend=False the order of the tree looks funny. specifying
descend=False and
ascend=True gives me an order suitable for removing the whole tree (i am unsure if
reverse=True is needed) even while it is being recursed.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
ok. if i do explain this in the docs i'll just say that to get a full tree reverse one must use the per-directory reverse and use ascend items for directories instead of descend.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.