openpyxl: Cell | MergedCell annotations#13092
Merged
srittau merged 4 commits intoNov 25, 2024
Merged
Conversation
Avasam
commented
Nov 25, 2024
| ORIENTATION_PORTRAIT: Final = "portrait" | ||
| ORIENTATION_LANDSCAPE: Final = "landscape" | ||
|
|
||
| _cells: dict[tuple[int, int], _CellOrMergedCell] # private but very useful to understand typing |
Collaborator
Author
There was a problem hiding this comment.
I could just comment this out before merging, Users shouldn't be using this, but it's a useful note.
This comment has been minimized.
This comment has been minimized.
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
mutricyl
reviewed
Nov 28, 2024
| def iter_rows( | ||
| self, min_row: int | None, max_row: int | None, min_col: int | None, max_col: int | None, values_only: bool | ||
| ) -> Generator[tuple[Cell, ...], None, None] | Generator[tuple[str | float | datetime | None, ...], None, None]: ... | ||
| ) -> ( |
There was a problem hiding this comment.
Is this change related to issue #13151 ?
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.
Extracted and completed from #9511
This basically comes down to typing
Worksheet._cellsthen working up the tree of references.Then I checked all existing
Cellannotations as a sanity check.This does result in a few extra
Cell | MergedCellreturn types, which may negatively affect some users since no Cell-like type inherits fromCell. This is the same issue as #11718 and could be solved in the same way.Note that this does not address #9940