python-discord / bot

The community bot for the Python Discord community
https://pythondiscord.com
MIT License
1.33k stars 662 forks source link

Remove line numbers from !eval command output. #1697

Open lxnn opened 3 years ago

lxnn commented 3 years ago

In some cases they can make the output appear quite ugly. For example, here is the result of a command I ran yesterday (this is a printed Numpy array):

001 | [0.35319467 0.03863742 0.08606454 0.08990213 0.71744555 0.43287303
002 |  0.90408936 0.13358966 0.10614465 2.138059  ]

Once you introduce line-wrapping, it can end up looking like this:

001 | [0.35319467 0.03863742 0.08606454 0.08990213 0.71744555
0.43287303
002 |  0.90408936 0.13358966 0.10614465 2.138059  ]

As the output is limited to 10 lines, they aren't particularly useful -- I've not seen anyone make reference to the nth line of output. Also, as they are rendered in ascii, people sometimes mistakenly believe they are part of the output.

MarkKoz commented 3 years ago

I don't feel strongly either way. However, I do agree that they sometimes make the output ugly and that they seem to seldom be used. What does everyone else think?

ChrisLovering commented 3 years ago

Removing the line numbers will only give us an extra 6 characters of width, so the above example would still be wrapped anyway.

There isn't really a good solution to this, since it fully depends on the width of your monitor, and now if you have a thread open, since that will limit width even further.

Having the line numbers can be useful when it wraps like this, since it shows where the newlines are from stdout.

We could possibly look at changing the characters we use however, as the fact they blend in with the actual output can be misleading.

lxnn commented 3 years ago

To be honest, I originally gave too much weight to the wrapping. The main issue is the potential confusion caused by the line numbers appearing to be part of the output.

As this tool is mostly used to demonstrate the output of code snippets to learners, I feel that messing with that output is problematic. I'm often saying "ignore the stuff on the left" in help-sessions.

WillDaSilva commented 2 years ago

I would like to implement this for the upcoming Hacktoberfest 2021. @MarkKoz, if there are no objections to removing the line numbers, could you please assign the issue to me.

MarkKoz commented 2 years ago

@WillDaSilva I don't think Python Discord's projects will be participating in Hacktoberfest 2021. In any case, I don't know what the consensus on this issue is.

Kronifer commented 2 years ago

@WillDaSilva I don't think Python Discord's projects will be participating in Hacktoberfest 2021. In any case, I don't know what the consensus on this issue is.

@MarkKoz from what I've seen we will not be participating

wookie184 commented 4 months ago

I wouldn't mind trialling removing the numbers and see whether people notice/care.