This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE call hints and completions confused by ints and floats
Type: behavior Stage: test needed
Components: IDLE Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: epaine, terry.reedy, wyz23x2
Priority: normal Keywords:

Created on 2020-07-10 08:49 by wyz23x2, last changed 2022-04-11 14:59 by admin.

Messages (7)
msg373455 - (view) Author: wyz23x2 (wyz23x2) * Date: 2020-07-10 08:49
There is a function hex(number, /), and float objects have a method hex().
When something like 1.3.hex( is typed, the yellow box's first line contains hex(number, /). But the method is actually hex(), no arguments. It confuses users.
And when 1.3.list( is typed, there isn't a list() method in floats, but the hint still pops up and shows the __doc__ for list(iterable=(), /).
msg373528 - (view) Author: E. Paine (epaine) * Date: 2020-07-11 17:11
Both of the following cases give the correct popup help information:

float.hex(

And:

t = type("test_hex", (), {"hex": lambda nothing: None})
t.hex(

The reason your case fails is because IDLE doesn't evaluate `1.3` to a float and does indeed use the normal `hex` method help (as you established with your `list` test).
msg373539 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-07-11 21:04
Neither '1 .bit_length()' (space required) nor '1.3.hex()', both legal syntax, get either proper completions or call hints.  Neither does the erroneous syntax '1.bit_length'. This suggests that the backwards parsing from the final '.' could be improved.  The first place to look would be whatever common code there is in hyperparser.

(Side note: something.x<tab> tabs if no completions are found.  Should inproved doc on this.)
msg402406 - (view) Author: wyz23x2 (wyz23x2) * Date: 2021-09-22 04:38
Ping.
>>> from datetime import datetime as d
>>> d(2021, 9, 22)-d(2020, 7, 10)
datetime.timedelta(days=439)
msg402439 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-09-22 14:34
What is your point?  Code without explanation is useless.
msg412233 - (view) Author: wyz23x2 (wyz23x2) * Date: 2022-02-01 02:41
Ping, this issue is 571 days old.
msg412235 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2022-02-01 05:01
There are 1000s of open python issues and perhaps 200 for IDLE. I consider this one to be lower priority that enough others to fill my IDLE time.
History
Date User Action Args
2022-04-11 14:59:33adminsetgithub: 85438
2022-02-01 05:01:37terry.reedysetstage: test needed
messages: + msg412235
versions: + Python 3.11, - Python 3.8, Python 3.9, Python 3.10
2022-02-01 02:41:40wyz23x2setmessages: + msg412233
2021-09-22 14:34:45terry.reedysetmessages: + msg402439
2021-09-22 04:38:43wyz23x2setmessages: + msg402406
2020-07-11 21:04:00terry.reedysettype: behavior
title: Wrong hint when class methods and builtins named same -> IDLE call hints and completions confused by ints and floats
messages: + msg373539
versions: - Python 3.7
2020-07-11 17:11:59epainesetnosy: + epaine
messages: + msg373528
2020-07-10 08:49:55wyz23x2create