我有這樣的代碼: import pyqtgraph as pg # Short name cause pyqtgraph is looong
import pyqtgraph.exporters
# ... some code
pg.foo()
pg.exporters.ExportItem(blah)
現在pylint的埋怨import pyqtgraph.exporters說這
我讀了很多關於泛型類的內容,雖然這些類很酷,但有時候我只需要一個泛型函數。這是我寫的一個小的: def _matrix_map(self, mapper):
"""returns the matrix applying the mapper funcfunc"""
return {key: mapper(value) for key, value in self._matrix