Skip to content

[3.14] gh-101100: Resolve some os sphinx reference warnings (GH-139636)#151765

Closed
miss-islington wants to merge 2 commits into
python:3.14from
miss-islington:backport-fa60354-3.14
Closed

[3.14] gh-101100: Resolve some os sphinx reference warnings (GH-139636)#151765
miss-islington wants to merge 2 commits into
python:3.14from
miss-islington:backport-fa60354-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

…H-139636)

(cherry picked from commit fa60354)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Comment thread Doc/library/os.rst
:func:`unsetenv` will be called automatically when an item is deleted from
:data:`os.environ`, and when one of the :meth:`pop` or :meth:`clear` methods is
called.
:data:`os.environ`, and when one of the :meth:`~dict.pop` or

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I do not think this was correct. This is not a dict, it has different pop and clear methods. Please revert in main.

@cmaloney cmaloney Jun 20, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I disagree. The special behavior (ex. unsetenv call) is documented as well as the general documentation for mapping types which lives inside the stdtypes documention of dict (https://docs.python.org/3/library/stdtypes.html#mapping-types-dict).

I agree we could document the _Environ special type specifically and/or refer to generic collections.abc.MutableMapping + the specialized __getitem__ and __setitem__ which _Environ uses to specialize behavior. I am happy to review those changes as new PRs and further improvements.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

_Environ is not a dict subclass. It should refer to MutableMapping.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That unfortunately doesn't define what pop or clear should generally do: https://docs.python.org/3/library/collections.abc.html#collections.abc.MutableMapping

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a separate issue, bur references to dict are incorrect.

This is why we have to keep warnings. As a signal that something need to be fixed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm happy for others to work on these changes. I was attempting to make improvements.

@bedevere-app

bedevere-app Bot commented Jun 20, 2026

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@cmaloney cmaloney closed this Jun 20, 2026
@miss-islington miss-islington deleted the backport-fa60354-3.14 branch June 20, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants