git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]# a,b = 2,3 and [a,b] = [2,3]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Eko palypse <ekopalypse at gmail.com> writes: > Am Montag, 2. September 2019 00:49:05 UTC+2 schrieb Hongyi Zhao: > > Hi, > > > > What's differences: > > > > a,b = 2,3 and [a,b] = [2,3] > > > > Regards > > In this example the result is the same but the second one > builds, internally, an additional list, therefore isn't as sufficient > as the first one. It looks to me like they generate identical code. The first one calls the construction of a tuple, where the second one calls for the construction of a list. It would be surprising if the compiler optimized the tuple away, but failed to optimize the list away! -- Alan Bawden

- Prev by Date:
**How to create a list and append to list inside a mqtt and GUI program?** - Next by Date:
**a,b = 2,3 and [a,b] = [2,3]** - Previous by thread:
**a,b = 2,3 and [a,b] = [2,3]** - Next by thread:
**a,b = 2,3 and [a,b] = [2,3]** - Index(es):