__aexit__

Dunder MethodPython 2.0+Expert

Async version of __exit__ for async with blocks

Quick Info

Documentation
Official Docs
Python Version
2.0+

Learn by Difficulty

Quick Example

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

obj = Example()
print(obj)

__aexit__ async version of __exit__ for async with blocks. Implementing it lets you customize how Python interacts with your objects.

Try in Playground

Tags

oopmagic-methodprotocolcore