Skip to content

[3.8] bpo-40181: Remove '/' reminder in IDLE calltips. (GH-22350) #22352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Lib/idlelib/NEWS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Released on 2020-09-14?
======================================


bpo-40181: In calltips, stop reminding that '/' marks the end of
positional-only arguments.

bpo-41468: Improve IDLE run crash error message (which users should
never see).

Expand Down
4 changes: 0 additions & 4 deletions Lib/idlelib/calltip.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def get_entity(expression):
_first_param = re.compile(r'(?<=\()\w*\,?\s*')
_default_callable_argspec = "See source or doc"
_invalid_method = "invalid method signature"
_argument_positional = " # '/' marks preceding args as positional-only."

def get_argspec(ob):
'''Return a string describing the signature of a callable object, or ''.
Expand Down Expand Up @@ -146,9 +145,6 @@ def get_argspec(ob):
else:
argspec = ''

if '/' in argspec and len(argspec) < _MAX_COLS - len(_argument_positional):
# Add explanation TODO remove after 3.7, before 3.9.
argspec += _argument_positional
if isinstance(fob, type) and argspec == '()':
# If fob has no argument, use default callable argspec.
argspec = _default_callable_argspec
Expand Down
8 changes: 3 additions & 5 deletions Lib/idlelib/idle_test/test_calltip.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,16 @@ class SB: __call__ = None

if List.__doc__ is not None:
tiptest(List,
f'(iterable=(), /){calltip._argument_positional}'
f'(iterable=(), /)'
f'\n{List.__doc__}')
tiptest(list.__new__,
'(*args, **kwargs)\n'
'Create and return a new object. '
'See help(type) for accurate signature.')
tiptest(list.__init__,
'(self, /, *args, **kwargs)'
+ calltip._argument_positional + '\n' +
'(self, /, *args, **kwargs)\n'
'Initialize self. See help(type(self)) for accurate signature.')
append_doc = (calltip._argument_positional
+ "\nAppend object to the end of the list.")
append_doc = "\nAppend object to the end of the list."
tiptest(list.append, '(self, object, /)' + append_doc)
tiptest(List.append, '(self, object, /)' + append_doc)
tiptest([].append, '(object, /)' + append_doc)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
In calltips, stop reminding that '/' marks the end of positional-only
arguments.