__anext__

Dunder MethodPython 2.0+Expert

Returns the next value from an async iterator

Quick Info

Documentation
Official Docs
Python Version
2.0+

Learn by Difficulty

Quick Example

python
class Example:
    def __anext__(self):
        return "Example __anext__"

obj = Example()
print(obj)

__anext__ returns the next value from an async iterator. Implementing it lets you customize how Python interacts with your objects.

Try in Playground

Tags

oopmagic-methodprotocolcore