Issue 15771: Tunple Bug? - Python tracker (original) (raw)
Issue15771
Created on 2012-08-23 08:27 by zhuojun, last changed 2022-04-11 14:57 by admin. This issue is now closed.
Messages (3) | ||
---|---|---|
msg168929 - (view) | Author: zhuojun (zhuojun) | Date: 2012-08-23 08:27 |
>>> def f(*agrs): print(agrs) >>> f(1,2) (1, 2) >>> f(1) #Is the output wrong? It should be without ','. (1,) | ||
msg168930 - (view) | Author: Ezio Melotti (ezio.melotti) * ![]() |
Date: 2012-08-23 08:30 |
Tuples with one element are defined as (x,), since the comma is what really makes the tuple. | ||
msg168931 - (view) | Author: Ezio Melotti (ezio.melotti) * ![]() |
Date: 2012-08-23 08:33 |
See the second code block here: http://docs.python.org/py3k/tutorial/datastructures.html#tuples-and-sequences |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:57:35 | admin | set | github: 59975 |
2012-08-23 08:33:11 | ezio.melotti | set | messages: + |
2012-08-23 08:30:37 | ezio.melotti | set | status: open -> closedassignee: ezio.melottinosy: + ezio.melottimessages: + resolution: not a bugstage: resolved |
2012-08-23 08:27:22 | zhuojun | create |