I have written following code to determine type of decimal localcontext:
print('decimal.localcontext() type: ', type(decimal.localcontext()))
Output:
decimal.localcontext() type: <class 'decimal.ContextManager'> #ContextManager
However, the following code is returning a different output for type:
with decimal.localcontext() as ctx1:
print(type(ctx1))
Output:
<class 'decimal.Context'>
My question is why the second code snippet is returning decimal.Context instead of
decimal.ContextManager