ValueError: too many values to unpack - Is it possible to ignore one value?

前端 未结 4 1429
夕颜
夕颜 2020-12-20 19:34

The following line returns an error:

self.m, self.userCodeToUserNameList, self.itemsList, self.userToKeyHash, self.fileToKeyHash = readUserFileMatrixFromFile         


        
4条回答
  •  天命终不由人
    2020-12-20 20:17

    Just, use the throw-away variable '_'

      self.m, 
      self.userCodeToUserNameList, 
      self.itemsList, 
      self.userToKeyHash, 
      self.fileToKeyHash, 
      _ = readUserFileMatrixFromFile(x,True)
    

    here '_' is deliberately ignored.

提交回复
热议问题