What is a function parameter =[] for?

Chris Angelico rosuav at gmail.com
Wed Nov 25 17:06:26 EST 2015


On Thu, Nov 26, 2015 at 8:05 AM, Antoon Pardon
<antoon.pardon at rece.vub.ac.be> wrote:
> Op 25-11-15 om 21:39 schreef Ian Kelly:
>> On Wed, Nov 25, 2015 at 11:27 AM, Antoon Pardon
>> <antoon.pardon at rece.vub.ac.be> wrote:
>>> I don't know what you are talking about. The first thing I have argued
>>> is that () is a literal. Then I have expaned that to that something
>>> like (3, 5, 8) is a literal. I never argued that tuple expressions
>>> in general are literals. And one way I supported my point was with the
>>> following quote from the python language reference.
>>>
>>>   Literals are notations for constant values of some built-in types.
>>>
>>> And I think that the things I argued were literals, were in fact
>>> constant values of some built-in type.
>>
>> I believe that sentence from the docs is using "some" to mean "not
>> all", whereas you are apparently using it to mean "any".
>>
>> frozenset([1,2,3]) constructs a constant value of a built-in type.
>> Would you consider that a literal?
>
> I am inclined to say yes, because a sufficient intelligent compilor
> can compute the value and store it do be retrieved and bound to a
> target when needed.

Then you're using the word "literal" in a way that is flat wrong. It
may be a constant, but it is not a literal.

ChrisA



More information about the Python-list mailing list