变量赋值加个逗号是什么意思
初学python,今天看源代码的时候,有点不明白变量赋值后加个逗号是什么意思
Python
msg, = bencode.decode(io.BufferedReader(io.BytesIO(data)))
>>> a,b=(1,3)
>>> a
1
>>> a,=(1,3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: too many values to unpack
>>> a,=1,2,3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: too many values to unpack