Strange location for a comma

Martin Komoň martin at mkomon.cz
Thu Sep 3 14:34:05 CEST 2015


In this case those are not tuples but rather arguments in a function
call. The extra comma does not change the evaluation, my guess is that
it is there for easier adding/removing arguments without having to care
about trailing commas.

Martin

On 03/09/15 14:28, ast wrote:
> 
> "ast" <nomail at invalid.com> a écrit dans le message de
> news:55e83afb$0$3157$426a74cc at news.free.fr...
>> Hello,
>> At the end of the last line of the following program,
>> there is a comma, I dont understand why ?
>>
>> Thx
>>
>>
>> from cx_Freeze import setup, Executable
>>
>> # On appelle la fonction setup
>> setup(
>>    name = "salut",
>>    version = "0.1",
>>    description = "Ce programme vous dit bonjour",
>>    executables = [Executable("salut.py")],    #  <--- HERE
>> )
>>
>>
> 
> Ok its understood, it's a 1 element only tuple
> 
> example:
> 
>>>> A = 5,
>>>> A
> (5,)
> 
>>>> A = (6)
>>>> A
> 6
> 


More information about the Python-list mailing list