__aiter__
can not be made async 938 def __iter__(self) -> t.Iterator[t.Any]:
939 yield from ()
940
941 async def __aiter__(self) -> t.AsyncIterator[t.Any]: 942 for _ in ():
943 yield
944
Magic methods that are not supposed to be asynchronous would not work as expected if they are made async
.
It is recommend to not make this magic method async
.
Follwing magic methods should not asynchronous:
__lshift__
__bytes__
__new__
__del__
__abs__
__eq__
__trunc__
__truediv__
__exit__
__getattr__
__repr__
__gt__
__and__
__dir__
__ifloordiv__
__rand__
__pow__
__set_name__
__format__
__rtruediv__
__complex__
__getitem__
__init_subclass__
__get__
__await__
__sub__
__ne__
__or__
__rmul__
__rxor__
__mod__
__rmod__
__subclasscheck__
__pos__
__int__
__round__
__add__
__ixor__
__mul__
__ipow__
__itruediv__
__missing__
__lt__
__hash__
__instancecheck__
__ror__
__aiter__
__xor__
__imul__
__delete__
__delitem__
__setitem__
__divmod__
__invert__
__contains__
__rpow__
__floor__
__len__
__iand__
__class_getitem__
__floordiv__
__setattr__
__enter__
__irshift__
__le__
__ilshift__
__init__
__rmatmul__
__rdivmod__
__radd__
__imod__
__iter__
__delattr__
__bool__
__length_hint__
__reversed__
__getattribute__
__isub__
__imatmul__
__rsub__
__rrshift__
__matmul__
__float__
__neg__
__str__
__rfloordiv__
__index__
__rlshift__
__ge__
__ior__
__iadd__
__rshift__
__set__
__ceil__
class BadClass:
async def __lt__(self, other):
...
class GoodClass:
def __lt__(self, other):
...