Message 113598 - Python tracker (original) (raw)
Actually, I'm not sure there's much point since the "name" attribute is currently read-only:
f = open(1, "wb") f.name = "foo" Traceback (most recent call last): File "", line 1, in AttributeError: attribute 'name' of '_io.BufferedWriter' objects is not writable
g = open(1, "w") g.name = "bar" Traceback (most recent call last): File "", line 1, in AttributeError: attribute 'name' of '_io.TextIOWrapper' objects is not writable