On 2015-11-24, Chris Angelico <ros...@gmail.com> wrote: > On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon ><antoon.par...@rece.vub.ac.be> wrote: >>> Start thinking of it as a constructor call rather than a literal, and >>> you'll get past most of the confusion. >> >> That doesn't change the fact it does look like a literal and not like >> a constructor. > > Neither of them is a literal, even though one of them isn't even > constructing a list. Tuples may be constant, but they still don't have > a literal form.
How do you define "literal form"? I define it as any syntax that can participate in ast.literal_eval (And I consider [...] to be a literal form regardless of whether the ... values are literals or not). I don't think "Start thinking of it as a constructor call rather than a literal" is helpful, since it just hides one's confusion about what a literal is. The Python documentation itself seems to assume that "literal" should only be used for things that are a single token, though I have no idea where this thinking comes from. -- https://mail.python.org/mailman/listinfo/python-list