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.
2.1m questions
2.1m answers
60 comments
57.0k users