fix(http-client-python): clarify _model_base.py mapping docstrings#11216
Merged
msyyc merged 1 commit intoJul 9, 2026
Merged
Conversation
commit: |
Replace the ambiguous 'D' placeholder (inherited from CPython's MutableMapping ABC docstrings) in the generated _MyMutableMapping base class with plain-English descriptions. Fixes microsoft#11196 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
6d2ad2b to
875fc93
Compare
Contributor
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
iscai-msft
approved these changes
Jul 9, 2026
Member
Author
msyyc
approved these changes
Jul 9, 2026
tadelesh
pushed a commit
that referenced
this pull request
Jul 9, 2026
…11216) Fixes #11196 ## Problem The generated `_MyMutableMapping` base class in `_model_base.py` had docstrings using an ambiguous `D` placeholder (inherited from CPython's `MutableMapping` ABC), e.g.: ```python def clear(self) -> None: """ Remove all items from D. """ ``` Users couldn't tell what `D` stood for. ## Fix Updated `model_base.py.jinja2` to use plain-English descriptions: - `clear` -> "Remove all items from the dictionary." - `keys`/`values`/`items` -> "a view on the mapping's keys/values/items" - `get` / `setdefault` -> replaced `D[k] if k in D, else d` with clear wording - `update` -> "Update the dictionary from a mapping or an iterable of key-value pairs." - `popitem` -> "if the dictionary is empty." The generated test output (`tests/generated`) is not committed, so no regeneration of committed files was required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11196
Problem
The generated
_MyMutableMappingbase class in_model_base.pyhad docstrings using an ambiguousDplaceholder (inherited from CPython'sMutableMappingABC), e.g.:Users couldn't tell what
Dstood for.Fix
Updated
model_base.py.jinja2to use plain-English descriptions:clear-> "Remove all items from the dictionary."keys/values/items-> "a view on the mapping's keys/values/items"get/setdefault-> replacedD[k] if k in D, else dwith clear wordingupdate-> "Update the dictionary from a mapping or an iterable of key-value pairs."popitem-> "if the dictionary is empty."The generated test output (
tests/generated) is not committed, so no regeneration of committed files was required.