title: Python 3.5.1: QVariant represents a mapped type and cannot be instantiated
body: <p>I'm working with Python 3.5.1 and I'm trying to run this code but I have a problem with QVariant </p>
  
  <pre><code>from PyQt4.QtCore import *
  from PyQt4.QtGui import *
  import sys
  class Model(QAbstractTableModel):
      def __init__(self, parent=None, *args):
          QAbstractTableModel.__init__(self, parent, *args)
          self.items = ['Item_A_001','Item_A_002','Item_B_001','Item_B_002']
  
      def rowCount(self, parent=QModelIndex()):
          return len(self.items)       
      def columnCount(self, parent=QModelIndex()):
          return 1
  
      def data(self, index, role):
          if not index.isValid(): return QVariant()
          elif role != Qt.DisplayRole:
              return QVariant()
  
          row=index.row()
          if row&lt;len(self.items):
              return QVariant(self.items[row])
          else:
              return QVariant()
  
  class Proxy(QSortFilterProxyModel):
      def __init__(self):
          super(Proxy, self).__init__()
          self.filterActive = False
  
      def setView(self, view):
          self._view = view
  
      def filterAcceptsRow(self, row, parent):
          if self.filterActive and '_B_' in self.sourceModel().data(self.sourceModel().index(row, 0), Qt.DisplayRole).toPyObject():
          self._view.selectRow(row)
          return True
  
  class MyWindow(QWidget):
      def __init__(self, *args):
          QWidget.__init__(self, *args)
  
          tableModel=Model(self)               
  
          proxyModel=Proxy()
          proxyModel.setSourceModel(tableModel)
  
          self.tableview=QTableView(self) 
          self.tableview.setModel(proxyModel)
          self.tableview.horizontalHeader().setStretchLastSection(True)
          self.tableview.setSelectionMode(QAbstractItemView.MultiSelection)
  
          proxyModel.setView(self.tableview)
  
          button=QPushButton(self)
          button.setText('Select Items with B')
          button.clicked.connect(self.clicked)
  
          layout = QVBoxLayout(self)
          layout.addWidget(self.tableview)
          layout.addWidget(button)
          self.setLayout(layout)
  
      def clicked(self, arg):
          proxyModel=self.tableview.model()
          self.tableview.clearSelection()
          proxyModel.filterActive = True
          proxyModel.invalidateFilter()
  
  if __name__ == "__main__":
      app = QApplication(sys.argv)
      w = MyWindow()
      w.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>Indeed, when I execute this code an error message appears: QVariant Represents a mapped kind and can not be instantiated .
  I tried to remove the QVariant and putting None inplace</p>
  
  <pre><code>def data(self, index, role):
      if not index.isValid(): return None
      elif role != Qt.DisplayRole:
          return None
  
      row=index.row()
      if row&lt;len(self.items):
          return (self.items[row])
      else:
          return None
  </code></pre>
  
  <p>But a new error message appears: 'str' object has no attribute 'toPyObject'.</p>
  
  <p>Thank you for helping me</p>