docs: clarify copy_range destination behavior#1591
Merged
antoineeripret merged 1 commit intoJun 23, 2026
Merged
Conversation
The dest docstring incorrectly stated the destination range size has no effect. Document the actual behavior: when dest spans a multiple of the source, the source is repeated to fill it; when smaller, the full source is copied anyway. Also fix grammar and add a CopyPasteRequest reference. Closes burnash#1550
Collaborator
|
Great catch, thank you @Gardner-Programs ! |
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.
Summary
Closes #1550.
The
destparameter docstring forWorksheet.copy_rangeclaimed the destination range size "has no effect" and that the source is always copied once regardless ofdest. That is only true whendestis a single cell or smaller than the source. Whendestis larger, the source is actually repeated to fill it, which is the behavior the issue reporter ran into and asked to have documented.What changed
Doc-only. Rewrote the
destdescription to document the real behavior:destspans a multiple of the source's height or width, the source is repeated to fill the destination range.destis smaller than the source, the entire source is copied anyway, beyond the end ofdest.Also fixed grammar ("paste" -> "pasted", "is copies" -> "is copied") and added a
CopyPasteRequestreference link next to the existingPaste Typeslink.Verification
The behavior was confirmed two ways:
CopyPasteRequestdocs, which state: "If the range covers a span that's a multiple of the source's height or width, then the data will be repeated to fill in the destination range. If the range is smaller than the source range, the entire source data will still be copied."No code changes, so no tests or cassettes are affected.