[Python-checkins] bpo-40181: Remove '/' reminder in IDLE calltips. (GH-22350)
Miss Islington (bot)
webhook-mailer at python.org
Tue Sep 22 02:02:54 EDT 2020
https://github.com/python/cpython/commit/7bcbb536dde2308558c6a80c011042c6c3efc626
commit: 7bcbb536dde2308558c6a80c011042c6c3efc626
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-09-21T23:02:45-07:00
summary:
bpo-40181: Remove '/' reminder in IDLE calltips. (GH-22350)
The marker was added to the language in 3.8 and
3.7 only gets security patches.
(cherry picked from commit 40a0625792e795cd41c4ba20475e3b770b53817a)
Co-authored-by: Terry Jan Reedy <tjreedy at udel.edu>
files:
A Misc/NEWS.d/next/IDLE/2020-09-22-00-45-40.bpo-40181.hhQi3z.rst
M Lib/idlelib/NEWS.txt
M Lib/idlelib/calltip.py
M Lib/idlelib/idle_test/test_calltip.py
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index f395f0c72f662..2cb1910c6c3f3 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -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).
diff --git a/Lib/idlelib/calltip.py b/Lib/idlelib/calltip.py
index d4092c7847186..b02f87207d8db 100644
--- a/Lib/idlelib/calltip.py
+++ b/Lib/idlelib/calltip.py
@@ -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 ''.
@@ -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
diff --git a/Lib/idlelib/idle_test/test_calltip.py b/Lib/idlelib/idle_test/test_calltip.py
index d386b5cd81321..4d53df17d8cc7 100644
--- a/Lib/idlelib/idle_test/test_calltip.py
+++ b/Lib/idlelib/idle_test/test_calltip.py
@@ -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)
diff --git a/Misc/NEWS.d/next/IDLE/2020-09-22-00-45-40.bpo-40181.hhQi3z.rst b/Misc/NEWS.d/next/IDLE/2020-09-22-00-45-40.bpo-40181.hhQi3z.rst
new file mode 100644
index 0000000000000..b6866e19c4d41
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2020-09-22-00-45-40.bpo-40181.hhQi3z.rst
@@ -0,0 +1,2 @@
+In calltips, stop reminding that '/' marks the end of positional-only
+arguments.
More information about the Python-checkins
mailing list