]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-21760: fix __file__ description (GH-19097)
authorFurkan Onder <furkantahaonder@gmail.com>
Wed, 9 Jun 2021 21:10:20 +0000 (00:10 +0300)
committerGitHub <noreply@github.com>
Wed, 9 Jun 2021 21:10:20 +0000 (14:10 -0700)
Doc/reference/import.rst
Misc/NEWS.d/next/Documentation/2020-03-21-01-19-28.bpo-21760.CqofIc.rst [new file with mode: 0644]

index 2ef5b901b930bf55b980840c4fda4d2355bfc4ed..81a124f745ab6ad3f3ca18ca0619ac63e7cb7fc4 100644 (file)
@@ -603,9 +603,14 @@ the module.
 .. attribute:: __file__
 .. attribute:: __cached__
 
-   ``__file__`` is optional. If set, this attribute's value must be a
-   string.  The import system may opt to leave ``__file__`` unset if it
-   has no semantic meaning (e.g. a module loaded from a database).
+   ``__file__`` is optional (if set, value must be a string). It indicates
+   the pathname of the file from which the module was loaded (if
+   loaded from a file), or the pathname of the shared libray file
+   for extension modules loaded dynamically from a shared library.
+   It might be missing for certain types of modules, such as C
+   modules that are statically linked into the interpreter, and the
+   import system may opt to leave it unset if it has no semantic
+   meaning (e.g. a module loaded from a database).
 
    If ``__file__`` is set, it may also be appropriate to set the
    ``__cached__`` attribute which is the path to any compiled version of
diff --git a/Misc/NEWS.d/next/Documentation/2020-03-21-01-19-28.bpo-21760.CqofIc.rst b/Misc/NEWS.d/next/Documentation/2020-03-21-01-19-28.bpo-21760.CqofIc.rst
new file mode 100644 (file)
index 0000000..119ef3d
--- /dev/null
@@ -0,0 +1,2 @@
+The description for __file__ fixed.\r
+Patch by Furkan Onder
\ No newline at end of file