Skip to content

Commit 40a0625

Browse files
authored
bpo-40181: Remove '/' reminder in IDLE calltips. (pythonGH-22350)
The marker was added to the language in 3.8 and 3.7 only gets security patches.
1 parent 6c33385 commit 40a0625

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

Lib/idlelib/NEWS.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ Released on 2020-10-05?
33
======================================
44

55

6+
bpo-40181: In calltips, stop reminding that '/' marks the end of
7+
positional-only arguments.
8+
69
bpo-41468: Improve IDLE run crash error message (which users should
710
never see).
811

Lib/idlelib/calltip.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ def get_entity(expression):
118118
_first_param = re.compile(r'(?<=\()\w*\,?\s*')
119119
_default_callable_argspec = "See source or doc"
120120
_invalid_method = "invalid method signature"
121-
_argument_positional = " # '/' marks preceding args as positional-only."
122121

123122
def get_argspec(ob):
124123
'''Return a string describing the signature of a callable object, or ''.
@@ -146,9 +145,6 @@ def get_argspec(ob):
146145
else:
147146
argspec = ''
148147

149-
if '/' in argspec and len(argspec) < _MAX_COLS - len(_argument_positional):
150-
# Add explanation TODO remove after 3.7, before 3.9.
151-
argspec += _argument_positional
152148
if isinstance(fob, type) and argspec == '()':
153149
# If fob has no argument, use default callable argspec.
154150
argspec = _default_callable_argspec

Lib/idlelib/idle_test/test_calltip.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,16 @@ class SB: __call__ = None
6161

6262
if List.__doc__ is not None:
6363
tiptest(List,
64-
f'(iterable=(), /){calltip._argument_positional}'
64+
f'(iterable=(), /)'
6565
f'\n{List.__doc__}')
6666
tiptest(list.__new__,
6767
'(*args, **kwargs)\n'
6868
'Create and return a new object. '
6969
'See help(type) for accurate signature.')
7070
tiptest(list.__init__,
71-
'(self, /, *args, **kwargs)'
72-
+ calltip._argument_positional + '\n' +
71+
'(self, /, *args, **kwargs)\n'
7372
'Initialize self. See help(type(self)) for accurate signature.')
74-
append_doc = (calltip._argument_positional
75-
+ "\nAppend object to the end of the list.")
73+
append_doc = "\nAppend object to the end of the list."
7674
tiptest(list.append, '(self, object, /)' + append_doc)
7775
tiptest(List.append, '(self, object, /)' + append_doc)
7876
tiptest([].append, '(object, /)' + append_doc)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
In calltips, stop reminding that '/' marks the end of positional-only
2+
arguments.

0 commit comments

Comments
 (0)