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: Tunple Bug?
Type: behavior Stage: resolved
Components: None Versions: Python 3.2
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: ezio.melotti, zhuojun
Priority: normal Keywords:

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) * (Python committer) 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) * (Python committer) 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:35adminsetgithub: 59975
2012-08-23 08:33:11ezio.melottisetmessages: + msg168931
2012-08-23 08:30:37ezio.melottisetstatus: open -> closed

assignee: ezio.melotti

nosy: + ezio.melotti
messages: + msg168930
resolution: not a bug
stage: resolved
2012-08-23 08:27:22zhuojuncreate