Skip to content

Commit 642ffcb

Browse files
Improve documentation.
1 parent 671df9b commit 642ffcb

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

Doc/library/functions.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,9 @@ are always available. They are listed here in alphabetical order.
336336
``__debug__`` is true), ``1`` (asserts are removed, ``__debug__`` is false)
337337
or ``2`` (docstrings are removed too).
338338

339-
The optional argument *module* specifies the module name used
340-
when filtering syntax warnings.
339+
The optional argument *module* specifies the module name.
340+
It is needed to unambiguous :ref:`filter <_warning-filter>` syntax warnings
341+
by module name.
341342

342343
This function raises :exc:`SyntaxError` if the compiled source is invalid,
343344
and :exc:`ValueError` if the source contains null bytes.

Doc/library/importlib.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,9 @@ ABC hierarchy::
471471
With the subsequent code object one can execute it in a module by
472472
running ``exec(code, module.__dict__)``.
473473

474-
The optional argument *fullname* specifies the name of the module used
475-
when filtering syntax warnings.
474+
The optional argument *fullname* specifies the module name.
475+
It is needed to unambiguous :ref:`filter <_warning-filter>` syntax
476+
warnings by module name.
476477

477478
.. versionadded:: 3.4
478479

Doc/library/symtable.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ Generating Symbol Tables
2626
Return the toplevel :class:`SymbolTable` for the Python source *code*.
2727
*filename* is the name of the file containing the code. *compile_type* is
2828
like the *mode* argument to :func:`compile`.
29-
The optional argument *module* specifies the module name used
30-
when filtering syntax warnings.
29+
The optional argument *module* specifies the module name.
30+
It is needed to unambiguous :ref:`filter <_warning-filter>` syntax warnings
31+
by module name.
3132

3233
.. versionadded:: next
3334
Added the *module* parameter.

Doc/whatsnew/3.15.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ Other language changes
310310
* Many functions related to compiling or parsing Python code, such as
311311
:func:`compile`, :func:`ast.parse`, :func:`symtable.symtable`,
312312
and :func:`importlib.abc.InspectLoader.source_to_code`, now allow to pass
313-
the module name used when filtering syntax warnings.
313+
the module name. It is needed to unambiguous :ref:`filter <_warning-filter>`
314+
syntax warnings by module name.
314315
(Contributed by Serhiy Storchaka in :gh:`135801`.)
315316

316317

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
Many functions related to compiling or parsing Python code, such as
22
:func:`compile`, :func:`ast.parse`, :func:`symtable.symtable`, and
3-
:func:`importlib.abc.InspectLoader.source_to_code` now allow to pass the module
4-
name used when filtering syntax warnings.
3+
:func:`importlib.abc.InspectLoader.source_to_code` now allow to specify
4+
the module name.
5+
It is needed to unambiguous :ref:`filter <_warning-filter>` syntax warnings
6+
by module name.

0 commit comments

Comments
 (0)