Re: Parens do create a tuple (was: one-element tuples [Was: Most probably a stupid question, but I still want to ask])

2016-04-10 Thread Tim Chase
On 2016-04-11 10:45, Ben Finney wrote: > Also, there is another obvious way to create an empty tuple: call > the ‘tuple’ type directly: > > >>> foo = tuple() > >>> print(type(foo), len(foo)) > 0 But here the parens make the tuple too: >>> foo = tuple >>> print(type(foo))

Re: Parens do create a tuple (was: one-element tuples [Was: Most probably a stupid question, but I still want to ask])

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 05:45 PM, Ben Finney wrote: > So, let's please stop saying “parens don't create a tuple”. They do, and > because of that I've stopped saying that false over-simplification. I stand by "parens don't make a tuple", with the caveat that I should have mentioned the empty

Re: Parens do create a tuple (was: one-element tuples [Was: Most probably a stupid question, but I still want to ask])

2016-04-10 Thread Chris Angelico
On Mon, Apr 11, 2016 at 10:45 AM, Ben Finney wrote: > So the expanation that remains true when you examine it is: People > wanted a literal syntax to create a zero-length tuple. A pair of parens > is that literal syntax, and it's the parens that create the (empty) >

Parens do create a tuple (was: one-element tuples [Was: Most probably a stupid question, but I still want to ask])

2016-04-10 Thread Ben Finney
Stephen Hansen writes: > […] parens don't make tuples, commas do. Chris Angelico writes: > The thing you're confused at is that it's not the parentheses that > create a tuple. Parentheses merely group. MRAB writes: > As