Re: type annotations for xpath list
10:02 AM, Martin Alaçam wrote: > > Hello, > > > > I have the following descriptor: > > > > self._pi = None > > @property > > def pi(self) -> list: > > self._pi = self._root.xpath('processing-instruction()') >
type annotations for xpath list
Hello, I have the following descriptor: self._pi = None @property def pi(self) -> list: self._pi = self._root.xpath('processing-instruction()') return self._pi Mypy says: "Incompatible return value type (got "None", expected "List[Any]")" The xpath expression always r