Python Forum
question about adding a feature
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
question about adding a feature
#1
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.
Reply
#2
You could have another option with values "prefix"|"infix"|"postfix"
Reply
#3
(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.
Reply
#4
Oh I think I misunderstood the original question. If you have 'descend' and 'ascend' options, I don't think the value of 'reverse' should implicitly alter these values. It would be confusing.
Reply
#5
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Misplaced question: How do you describe this feature? Drone4four 3 2,227 Sep-17-2020, 11:26 PM
Last Post: Drone4four

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020