Skip to content

Conversation

@znsoooo
Copy link
Contributor

@znsoooo znsoooo commented Dec 20, 2025

Issue: #94520

The text display widget in the "CalltipWindow" has been changed from "tk.Label" to "ScrolledText", and now the text in the "Calltip" window can be selected with mouse.

The display size of the "CalltipWindow" is set to the smaller value between the size when using the "tk.Label" widget and the default size of "tk.Text".

When the displayed text exceeds the display area of the "ScrolledText" window, showing the vertical scrollbar; otherwise, hiding the scrollbar.

Since more text can be displayed, "argspec" is no longer truncated, and the tests related to the max lines or text truncation have been removed from the unit tests.


I'm sorry for the long delay due to moving house, many data on my computer was lost, it tooks me a very long time to reorganize. But now we can restart.

@znsoooo znsoooo requested a review from terryjreedy as a code owner December 20, 2025 22:26
@python-cla-bot
Copy link

python-cla-bot bot commented Dec 20, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@picnixz picnixz changed the title gh-94520: Make CallTips selectable gh-94520: Make CallTips selectable in IDLE Dec 25, 2025
Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why the splitting algorithm got changed as well and why some tests were removed.

Return the string obtained by replacing the leftmost non-overlapping \
occurrences of pattern in string by the replacement repl.''')

def test_signature_wrap(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are still checking the wrapping here so I would prefer keeping the test name.

def test_signature_wrap(self):
def test_signature(self):
if textwrap.TextWrapper.__doc__ is not None:
self.assertEqual(get_spec(textwrap.TextWrapper), '''\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid only checking the first line? please check the entire docstring (it also helps reducing the diff)

"aaaaaaaaaa')"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')"
sbar = "(s='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"\
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n" + indent + "aaaaaaaaa"\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we changing those tests?


@unittest.skipIf(MISSING_C_DOCSTRINGS,
"Signature information for builtins requires docstrings")
def test_multiline_docstring(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing this test?

Comment on lines +1 to +11
Make CallTips selectable

The text display widget in the "CalltipWindow" has been changed from
"tk.Label" to "ScrolledText", and now the text in the "Calltip" window can
be selected with mouse. The display size of the "CalltipWindow" is set to
the smaller value between the size when using the "tk.Label" widget and the
default size of "tk.Text". When the displayed text exceeds the display area
of the "ScrolledText" window, showing the vertical scrollbar; otherwise,
hiding the scrollbar. Since more text can be displayed, "argspec" is no
longer truncated, and the tests related to the max lines or text truncation
have been removed from the unit tests. Contributed by Shixian Li.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pleae make it shorter. There is a lot of text and I don't think everything is needed.

@bedevere-app
Copy link

bedevere-app bot commented Dec 25, 2025

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants