-
-
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] Annotate Worksheet and other items #9892
Conversation
I'll update #9511 if this gets merged first. |
@overload | ||
def __getitem__(self, key: int | slice) -> tuple[Cell, ...]: ... | ||
@overload | ||
def __getitem__(self, key: str) -> Any: ... # Cell | tuple[Cell, ...] |
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.
Another instance where python/typing#566 would come in handy.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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, a few comments:
|
||
class BoundDictionary(defaultdict[_KT, _VT], Generic[_KT, _VT]): | ||
reference: str | None | ||
def __init__(self, reference: str | None = None, *args, **kw) -> 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.
The *args, **kwargs
here just forward on the arguments to defaultdict.__init__
, but we have 8 overloads for that. So I'm fine with keeping this as it is for now.
@property | ||
def rows(self) -> Generator[Cell, None, None]: ... | ||
def rows(self) -> Generator[tuple[Cell, ...], None, None]: ... | ||
@property | ||
def values(self) -> Generator[str | float | datetime | None, None, None]: ... | ||
def values(self) -> 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.
@Avasam's annotations for these are slightly different:
Revert change to auto_type, might find a better solution in the future.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Alex Waygood <[email protected]>
This comment has been minimized.
This comment has been minimized.
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.
LGTM!
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
No description provided.