Skip to content

Commit

Permalink
__main__ module
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner committed Dec 5, 2023
1 parent 827c466 commit b98da1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion peps/pep-0737.rst
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,9 @@ The ``type.__fully_qualified_name__`` attribute omits the ``__main__``
module to produce shorter names for a common case: types defined in a
script run with ``python script.py``. For debugging, the ``repr()``
function can be used on a type, it includes the ``__main__`` module in
the type name.
the type name. Or use ``f"{type.__module__}.{type.__qualname__}"``
format to always include the module name, even for the ``"builtins"``
module.

Example of script::

Expand Down

0 comments on commit b98da1b

Please sign in to comment.