Re: type annotations for xpath list

2020-04-08 Thread Martin Alaçam
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

2020-04-08 Thread Martin Alaçam
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