You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have looked at the current implementation of Tree.show function in the master branch. I think the previous design is a bit confusing.
When stdout=True, I understand it to be using sys.stdout.buffer.write so I can directly write bytes to the console. However in tree.py line 932. It simply prints out the bytes with the print function. I don't understand why it was designed like that.
Refer to #215 , if the idea of stdout=True was to simply output to the console, then this is conflicting among users as I and this #230 have issues with encoding. I have to do print(tree.show(stdout=False) which makes stdout=True useless.
Hello, I have looked at the current implementation of
Tree.show
function in the master branch. I think the previous design is a bit confusing.When
stdout=True
, I understand it to be usingsys.stdout.buffer.write
so I can directly write bytes to the console. However in tree.py line 932. It simply prints out the bytes with theprint
function. I don't understand why it was designed like that.Refer to #215 , if the idea of
stdout=True
was to simply output to the console, then this is conflicting among users as I and this #230 have issues with encoding. I have to doprint(tree.show(stdout=False)
which makesstdout=True
useless.I suggest an improvement with the following:
Or add an
encoding
parameter to theshow
function, allowing use to choose #tree.show(encoding='utf-8')
if we having trouble with the final print.The text was updated successfully, but these errors were encountered: