Skip to content

Commit 0681b6d

Browse files
kovanclaude
andcommitted
gh-62734: Document that open()'s file param becomes name attribute
Clarify that the value passed as the *file* parameter to open() is stored in the name attribute of the returned file object. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7e2c9bd commit 0681b6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/library/functions.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,8 @@ are always available. They are listed here in alphabetical order.
13551355
relative to the current working directory) of the file to be opened or an
13561356
integer file descriptor of the file to be wrapped. (If a file descriptor is
13571357
given, it is closed when the returned I/O object is closed unless *closefd*
1358-
is set to ``False``.)
1358+
is set to ``False``.) The value passed as *file* is stored in the
1359+
:attr:`~io.IOBase.name` attribute of the returned file object.
13591360

13601361
*mode* is an optional string that specifies the mode in which the file is
13611362
opened. It defaults to ``'r'`` which means open for reading in text mode.

0 commit comments

Comments
 (0)