What is a function parameter =[] for?

Chris Angelico rosuav at gmail.com
Tue Nov 24 10:48:32 EST 2015


On Wed, Nov 25, 2015 at 2:46 AM, Antoon Pardon
<antoon.pardon at rece.vub.ac.be> wrote:
> What is your point? I say that [] looks like a literal. Because it
> sure resembles () which is a literal.
>
> That [] in fact isn't a literal doesn't contradict it looks like
> one.
>
> That you can come up with more complicated list expressions that
> are more easily recognizable as not being literals is beside the
> point because we have generator expressions that look similar to
> those list comprehensions and those generator expressions don't
> contradict that () is a literal.

() is not a literal either.

ChrisA



More information about the Python-list mailing list