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.
This commit is contained in:
parent
6c33385e3a
commit
40a0625792
|
@ -3,6 +3,9 @@ Released on 2020-10-05?
|
|||
======================================
|
||||
|
||||
|
||||
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).
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
In calltips, stop reminding that '/' marks the end of positional-only
|
||||
arguments.
|
Loading…
Reference in New Issue