The with statement does not appear to be returning the correct reference, instead it returns None.
class test():
def __init__(self) -> None:
pass
def __enter__(self):
print('entered')
def __exit__(self, exc_type, exc_val, exc_tb):
print('exit')
with test() as t:
print(type(t))
print('inside')
Output:
>entered
><class 'NoneType'>
>inside
>exit
I would like t to be the reference to the test instance, not None.
Python V3.10