◐ Shell
clean mode source ↗

Message 114417 - Python tracker

"""
with file("sample.py", "r") as f:
    pass
"""

The above code comes out of 2to3 with no modifications suggested. "file" is gone in 3.x and could be substituted with "open" usage in most cases. We would also have to handle or otherwise notify the user about code like "isinstance(x, file)".