]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40181: Remove '/' reminder in IDLE calltips. (GH-22350)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 22 Sep 2020 06:02:45 +0000 (23:02 -0700)
committerGitHub <noreply@github.com>
Tue, 22 Sep 2020 06:02:45 +0000 (23:02 -0700)
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@udel.edu>
Lib/idlelib/NEWS.txt
Lib/idlelib/calltip.py
Lib/idlelib/idle_test/test_calltip.py
Misc/NEWS.d/next/IDLE/2020-09-22-00-45-40.bpo-40181.hhQi3z.rst [new file with mode: 0644]

index f395f0c72f6626a682229d85dae7bb3a8e0ddc90..2cb1910c6c3f3652001bca9f1ee79b76f50087c6 100644 (file)
@@ -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).
 
index d4092c7847186bf6317fe0cdc97e5bd1d00ec520..b02f87207d8db18a228ce0b0468f5faadacb3efd 100644 (file)
@@ -118,7 +118,6 @@ _INDENT = ' '*4  # for wrapped signatures
 _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
index d386b5cd8132124bc9c8f3b3fe38bb209baa6955..4d53df17d8cc7c79188fe6a7f034bbada56068a2 100644 (file)
@@ -61,18 +61,16 @@ class Get_argspecTest(unittest.TestCase):
 
         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 (file)
index 0000000..b6866e1
--- /dev/null
@@ -0,0 +1,2 @@
+In calltips, stop reminding that '/' marks the end of positional-only
+arguments.