Conversation

edited

Edited 1 time

Carreau edited May 7, 2017 (most recent)

Compress user and location of stdlib/sitepackage.
That should make traceback identical on all machines, hopefully making
Google a bit better at finding them, and a little less wide in many
case.

The drawback is that filename are not copy-pastable to edit files, unless
situated somewhere not in site packages but that should be the case formost dev install, so I expect that to not bother many people.

This comment has been minimized.

I'm happy enough to use the compress_user function to abbreviate the home directory as ~. That saves some space, and you can still copy and paste the path to open it, at least on Unix.

I'm not convinced on $STDLIB, $SITE-PACKAGES, etc. I don't really like the separate delimited block at the top explaining variables. I don't like the $SUGGESTION that these are environment variables or shell variables. And both the standard library and site-packages can be in multiple locations (e.g. virtualenvs, Debian's dist-packages directories), so the simplifications won't work consistently.

Counterproposal

What makes the line so long is having the path and the function signature in one line. From your example, histogram(a, bins, range, normed, weights, density) is already 51 characters, so with the in, you only have 25 characters for the path before you hit 80 columns. What about putting them on separate lines:

edited

Edited 1 time

takluyver edited May 8, 2017 (most recent)

I'm happy enough to use the compress_user function to abbreviate the home directory as ~. That saves some space, and you can still copy and paste the path to open it, at least on Unix.

I'm not convinced on $STDLIB, $SITE-PACKAGES, etc. I don't really like the separate delimited block at the top explaining variables. I don't like the $SUGGESTION that these are environment variables or shell variables. And both the standard library and site-packages can be in multiple locations (e.g. virtualenvs, Debian's dist-packages directories), so the simplifications won't work consistently.

Counterproposal

What makes the line so long is having the path and the function signature in one line. From your example, histogram(a, bins, range, normed, weights, density) is already 51 characters, so with the in, you only have 25 characters for the path before you hit 80 columns. What about putting them on separate lines:

This comment has been minimized.

Yeah, I though about a large refactoring of traceback, you can even omit the filename if two consecutive frames have the same file, and I don't want to go this route (for now), counting line length with current architecture would be a pain.

I've push a simpler commit that just compress_user, and I'm fine delaying any other refactoring for later. If you think of any better layout please let me know.

Yeah, I though about a large refactoring of traceback, you can even omit the filename if two consecutive frames have the same file, and I don't want to go this route (for now), counting line length with current architecture would be a pain.

I've push a simpler commit that just compress_user, and I'm fine delaying any other refactoring for later. If you think of any better layout please let me know.