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: Confusing error message of 50,*2
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: wyz23x2
Priority: normal Keywords:

Created on 2020-10-06 05:12 by wyz23x2, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg378090 - (view) Author: wyz23x2 (wyz23x2) * Date: 2020-10-06 05:12
>>> (50,) * 2
(50, 50)
>>> 50, * 2
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
TypeError: 'int' object is not iterable

This message is confusing. It isn't clear that 50.__iter__ is called. tuple(50)*2 seems to happen, which isn't expected (at least to regular users). Not like "50 * 2," that relates to parsing.
msg378091 - (view) Author: wyz23x2 (wyz23x2) * Date: 2020-10-06 05:19
>>> '1', * 2
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
TypeError: 'int' object is not iterable

Update: 2.__iter__ seems to be called.
msg378092 - (view) Author: wyz23x2 (wyz23x2) * Date: 2020-10-06 05:36
Just updated to 3.9. Fixed.
History
Date User Action Args
2022-04-11 14:59:36adminsetgithub: 86119
2020-10-06 05:36:55wyz23x2setstatus: open -> closed
resolution: out of date
messages: + msg378092

stage: resolved
2020-10-06 05:19:32wyz23x2setmessages: + msg378091
2020-10-06 05:12:45wyz23x2create