Reconciling pyqtProperty and mypy
ben.green at geckorobotics.com
Tue Aug 18 19:54:14 BST 2020
I'm using pyqtProperty a lot, and mypy doesn't seem to play nicely with it.
When defining the setter, it gives a "name already defined" error. Also,
since the type is "Callable[..., Any]", instead of the actual type of the
property, references to that property can give errors.
def series(self) -> QAbstractSeries:
@series.setter # mypy error here: Name 'series' already defined on
def series(self, val):
self._series = val
self.series.replace() # mypy error here: "Callable[..., Any]"
has no attribute "replace"
Is there any way to reconcile these so I don't have to put in "type:
ignore" comments all over the place?
Ben Green | Software Engineer I
*GeckoRobotics* | geckorobotics.com
*o:* 412.407.2444 *m:* 484.895.5793
*e:* ben.green at geckorobotics.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt