-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openpyxl: Cell | MergedCell
annotations
#13092
openpyxl: Cell | MergedCell
annotations
#13092
Conversation
@@ -51,6 +51,7 @@ class Worksheet(_WorkbookChild): | |||
ORIENTATION_PORTRAIT: Final = "portrait" | |||
ORIENTATION_LANDSCAPE: Final = "landscape" | |||
|
|||
_cells: dict[tuple[int, int], _CellOrMergedCell] # private but very useful to understand typing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@overload | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change related to issue #13151 ?
Extracted and completed from #9511
This basically comes down to typing
Worksheet._cells
then working up the tree of references.Then I checked all existing
Cell
annotations as a sanity check.This does result in a few extra
Cell | MergedCell
return 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