cool-RR / PySnooper

Never use print for debugging again
MIT License
16.35k stars 951 forks source link

Truncate long variables in the middle #110

Closed alexmojaki closed 5 years ago

alexmojaki commented 5 years ago

In general there may be useful information at the end of a variable. This also solves the problem in #73

cool-RR commented 5 years ago

Good idea. But instead of string[:left], string[-right:] you can just do string[:left], string[left:] and not calculate right, right?

alexmojaki commented 5 years ago

They will be different if (max_length - 3) is odd. The -3 is not very important either. It's a perfectionist function. If you prefer I can simplify the function and let it be a few characters off.

cool-RR commented 5 years ago

They will be different if (max_length - 3) is odd.

Oops, I tried to be clever and made a basic mistake :)