663 async def revindex(self) -> int: # type: ignore
664 return await self.length - self.index0
665
666 async def _peek_next(self) -> t.Any: 667 if self._after is not missing:
668 return self._after
669
679 return await self._peek_next() is missing
680
681 @property
682 async def nextitem(self) -> t.Union[t.Any, "Undefined"]: 683 rv = await self._peek_next()
684
685 if rv is missing:
675 return self._after
676
677 @property
678 async def last(self) -> bool: # type: ignore 679 return await self._peek_next() is missing
680
681 @property
660 return await self.length - self.index
661
662 @property
663 async def revindex(self) -> int: # type: ignore 664 return await self.length - self.index0
665
666 async def _peek_next(self) -> t.Any:
656 return self._length
657
658 @property
659 async def revindex0(self) -> int: # type: ignore 660 return await self.length - self.index
661
662 @property
You're changing the method's type while overriding it in the child class. This may lead to unintentional bugs during runtime because of the incinsistency. Some of the cases where this issue would be raised are:
class BaseClass(metaclass=abc.ABCMeta):
@property
@abc.abstractmethod
def prop(self):
...
@abc.abstractmethod
def credit(self):
...
async def yell(self):
...
class InvalidDerived(BaseClass):
def prop(self): # Method was a property in the base class.
...
@property
def credit(self): # Method is being overridden as a `property`
...
def yell(self): # This was async in the base class
...
class ValidDerived(BaseClass):
@property
def prop(self):
return None
def credit(self):
return None
async def yell(self):
...