The hardest problem in computer science...

Ethan Furman ethan at stoneleaf.us
Fri Jan 6 10:37:40 EST 2017


On 01/06/2017 05:03 AM, Steve D'Aprano wrote:

> what do we call the vertical and horizontal line elements? I want to make
> them configurable, which means the user has to be able to pass an argument
> that specifies them. I have names for the individual components:
>
> XXX = namedtuple("XXX", "vline tee corner")
>
> default_YYY = XXX("│  ", "├─ ", "└─ ")
> bold_YYY = XXX("┃  ", "┣━ ", "┗━ ")
> ascii_YYY = XXX("|  ", "|- ", "+- ")
>
> def draw_tree(tree, YYY=default_YYY):
>      ...
>
> but what do I call XXX and YYY?

Looks like horizontal, vertical, and corner are as groups -- so I would call YYY "style" and XXX "default", "bold", and "ascii".

--
~Ethan~


More information about the Python-list mailing list