Inside a class method of a Python class, is it alright to use
with self as foo:
pass # more stuff here ...
(or even just with self:
) or will this cause some issues? The documentation doesn't seem to put any limitations on it and so far I didn't observe any erroneous behavior. But of course this could be limited to my exact Python version or use case.
And yes, the class is a context manager.