-
-
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 typeshed errors #9836
Comments
#9764 actually made wb = openpyxl.load_workbook(path)
ws = wb.active
assert isinstance(ws, Worksheet)
header = [cell.value for cell in ws[1]] # line 120 |
+1 what @srittau said. |
Thanks for the quick answer. I'll apply the workaround to fix the code. Maybe it could a good idea to write in the changelog that the type stubs are now more accurate and this may require changes to existing code bases that implicitly relied on wb.active to be |
@tritemio Unfortunately, our changelogs are currently auto-generated from git commit messages, which is why they are a bit messy and we can't edit them retroactively. |
Hello, apparently using the assert doesn't prevent mypy from reporting the error.. type hinting doesn't do much either, do you have any other solutions? |
I think the problems with |
In an internal project, updating to 3.0.4.7 causes mypy in strict mode to generate the following error:
The code for line 120 is:
and for line 124:
The same code checked using 3.0.4.6 passes all mypy checks in strick mode.
It seems like #9764 introduced a regression?
The text was updated successfully, but these errors were encountered: