[issue30086] type() and len() recognize "abc", expression as "abc" string.

2017-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: What you're seeing is a feature of the grammar. Function allow an optional trailing comma in the argument list: >>> pow(2, 5) 32 >>> pow(2, 5,) 32 So, to create a tuple inside in an argument list, you need the extra layer of parentheses.

[issue30086] type() and len() recognize "abc", expression as "abc" string.

2017-04-16 Thread umedoblock
New submission from umedoblock: But I found a real bug to use a tuple with a comma. Python3 recognized "abc", expression as tuple of one element. But type() and len() recognize "abc", expression as "abc" string. So now, I found a real bug. I'll show you below sentences. >>> "abc", ('abc',)