You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added the M__exit__ method to file to support "with open() as f" but the execution fails as following:
>>> with open("testfile") as f:
... print("hello")
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
FIXME line of source goes here
AttributeError: AttributeError: "'file' has no attribute '__exit__'"
The code in this case is only checking for the exit attribute instead of also checking for the implemented interface.
I added the M__exit__ method to file to support "with open() as f" but the execution fails as following:
The code in this case is only checking for the exit attribute instead of also checking for the implemented interface.
I see this comment:
But I am not sure of how ObjectLookSpecial could be implemented.
An easier way to do this, but it feels "wrong", would be to add an exit method in the object dictionary.
The text was updated successfully, but these errors were encountered: