MAINT: add missing space in warning and error messages (#32405) - #32428
Merged
Conversation
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
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.
Backport of #32405.
PR summary
Five user-facing messages run two sentences together because adjacent string
literals are concatenated without a trailing space:
This is the counterpart of b8c885d ("DOC: add space between words across
lines"), which fixed the format 3.0 warning in what is now
_format_impl.py(then
numpy/lib/format.py); the format 2.0 warning five lines above it stilllacks the space. The other sites are in
_core/fromnumeric.py,ma/mrecords.py, andlib/_twodim_base_impl.py(×2).One space per site, no logic changed. These are all the occurrences I found in
the package — similar-looking joins that are intentional (the regex fragments in
_core/_internal.py, the C macro template incode_generators/genapi.py,fragments whose continuation begins with
\n) were left alone. No test assertsacross any of these boundaries.
First time committer introduction
Hi, I work in Python for data analysis and data science, and lately I've been
building LLM agents on the side. I was reading through the error-handling code
of another library when I noticed this string-concatenation pattern, and since
NumPy is the library I use most, I checked whether it had the same issue — it
did, in five places. This is my first contribution to NumPy.
AI Disclosure
I used an AI assistant (Claude) to help scan for these sites and to draft and
polish this description. I ran and verified everything myself: all five messages
were reproduced locally on NumPy 2.5.2, the excluded cases were reviewed one by
one, and the 2019 precedent was confirmed in the git history. The change is five
single-space insertions with no logic change.