File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -363,6 +363,14 @@ I/O Base Classes
363363 As a convenience, it is allowed to call this method more than once;
364364 only the first call, however, will have an effect.
365365
366+ .. attribute :: name
367+
368+ The name of the underlying file if it has one.
369+ This is the *file * argument as passed to :func: `open ` or the constructor.
370+ The type of this attribute depends on what was originally passed - it may
371+ be a string, bytes, integer file descriptor, or other object representation.
372+ If there is no underlying file, the attribute may be ``None ``.
373+
366374 .. attribute :: closed
367375
368376 ``True `` if the stream is closed.
@@ -700,8 +708,11 @@ Raw File I/O
700708
701709 .. attribute :: name
702710
703- The file name. This is the file descriptor of the file when no name is
704- given in the constructor.
711+ The file name. This is the *name * argument as passed to the constructor.
712+ Depending on the type of object that was passed, this may be a string,
713+ bytes, integer file descriptor, or other object representation.
714+ If the file was opened using a file descriptor, the *name * attribute
715+ will contain the file descriptor value.
705716
706717
707718Buffered Streams
You can’t perform that action at this time.
0 commit comments