Skip to content

Update import.rst #22312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Update import.rst #22312

wants to merge 1 commit into from

Conversation

geryogam
Copy link
Contributor

@geryogam geryogam commented Sep 18, 2020

This minor PR adds missing prefixes __main__. and formatting tags :mod: in the section 5.8. Special considerations for __main__ of the import system documentation.

to the module spec of the corresponding module or package. ``__spec__`` is
also populated when the ``__main__`` module is loaded as part of executing a
When Python is started with the :option:`-m` option, ``__main__.__spec__`` is set
to the module spec of the corresponding module or package. ``__main__.__spec__`` is
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change does not improve the doc. The doc explains how the __spec__ module attribute is set, the attribute in the module namespace. The name (one of the names) of the module is not relevant here.

also populated when the ``__main__`` module is loaded as part of executing a
When Python is started with the :option:`-m` option, ``__main__.__spec__`` is set
to the module spec of the corresponding module or package. ``__main__.__spec__`` is
also populated when the :mod:`__main__` module is loaded as part of executing a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code markup is used on purpose to avoid creating 50 links when a module or function is named 50 times in a paragraph, that’s why there is :mod:__main__ on line 982 but just __main__ here.

Copy link
Member

@arhadthedev arhadthedev Jan 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@merwok Instead of manual markup, can pydoc be taught to create a link for the first occurence in a paragraph only? It will allow to not bother about visual pleasure and focus on semantics (an abstract examplelish notion vs a concrete field).

@merwok merwok closed this Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants