The following line returns an error:
self.m, self.userCodeToUserNameList, self.itemsList, self.userToKeyHash, self.fileToKeyHash = readUserFileMatrixFromFile(x,True)
The function actually returns 6 values. But in this case, the last one is useless (its None). So i want to store only 5.
Is it possible to ignore the last value?
You can use *rest from Python 3.
*rest
>>> x, y, z, *rest = 1, 2, 3, 4, 5, 6, 7 >>> x 1 >>> y 2 >>> rest [4, 5, 6, 7]
This way you can always be sure to not encounter unpacking issues.
1.4m articles
1.4m replys
5 comments
57.0k users