qtconsole: wrap argument list in tooltip to match width of text body #2662

Merged
merged 1 commit into from Dec 14, 2012

4 participants

@y-p
y-p commented Dec 6, 2012

previously, a function with a long argument list would produce
a very wide tooltip, hurting readability.

Since the width of the docstring body is chosen by the developer
whereas the formatting of the argument list is currently not, it's
reasonable to wrap the argument list width to the maximum of
a) 80 characters, or b) maximum length of a line in the docstring body.

This improves readability, without unduly affecting the appearence
of the docstring body itself.

closes #2661

I'm happy to add any additional tests or make any changes required to get this merged.

@y-p y-p qtconsole: wrap argument list in tooltip to match width of text body
previously, a function with a long argument list would produce
a very wide tooltip, hurting readability.

Since the width of the docstring body is chosen by the developer
whereas the formatting of the argument list is currently not, it's
reasonable to wrap the argument list width to the maximum of
a) 80 characters, or b) maximum length of a line in the docstring body.

This improved readability, without unduly affecting the appearence
of the docstring body itself.

closes #2661
2b49db1
@bfroehle

Great! Thanks for tackling this. Why not just wrap all lines at something like 80 characters? As you point out this may impact the formatting... but this is just a tooltip so nobody expects perfection.

@y-p
y-p commented Dec 7, 2012

I've had no issues with bodies being too wide, they are generally PEP8-ish.
Even If there is some overflow, it's usually fine on most screens.
And if you don't wrap at 80, whatever number you choose is wrong somehow.

"if the dev did a reasonably good job, it should look reasonably good"

@klonuo

closes the same reported issue: #2540

@y-p

bump. Is there anything I can do to help get this in?

@Carreau
IPython member
@Carreau
IPython member

I'm going to merge this as it is simple enough.

@Carreau Carreau merged commit 3f09b76 into ipython:master Dec 14, 2012

1 check passed

Details default The Travis build passed
@minrk minrk added a commit that referenced this pull request Mar 5, 2013
@minrk minrk Backport PR #2662: qtconsole: wrap argument list in tooltip to match …
…width of text body

previously, a function with a long argument list would produce
a very wide tooltip, hurting readability.

Since the width of the docstring body is chosen by the developer
whereas the formatting of the argument list is currently not, it's
reasonable to wrap the argument list width to the maximum of
a) 80 characters, or b) maximum length of a line in the docstring body.

This improves readability, without unduly affecting the appearence
of the docstring body itself.

closes #2661

I'm happy to add any additional tests or make any changes required to get this merged.
43e0fc2
@y-p y-p deleted the unknown repository branch Jan 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment