class documentation

class contextlib_nullcontext:

View In Hierarchy

Context manager that does no additional processing.

Used as a stand-in for a normal context manager, when a particular block of code is only sometimes used with a normal context manager:

cm = optional_cm if condition else nullcontext() with cm:

# Perform operation, using optional_cm if condition is True

Note

Prefer using contextlib.nullcontext instead of this context manager.

Method __enter__ Undocumented
Method __exit__ Undocumented
Method __init__ Undocumented
Instance Variable enter​_result Undocumented
def __enter__(self):

Undocumented

def __exit__(self, *excinfo):

Undocumented

def __init__(self, enter_result=None):

Undocumented

enter_result =

Undocumented