Skip to content
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

Fix _ErrorLog not iterable #100

Merged
merged 2 commits into from
Jun 4, 2024
Merged

Conversation

nsoranzo
Copy link
Contributor

Fix the following mypy error:

lib/galaxy/tool_util/linters/xsd.py:28: error: "_ErrorLog" has no attribute
"__iter__" (not iterable)  [attr-defined]
                for error in xsd.error_log:
                             ^~~~~~~~~~~~~

xref: https://github.com/galaxyproject/galaxy/pull/17081/files#r1490662640

Fix the following mypy error:
```
lib/galaxy/tool_util/linters/xsd.py:28: error: "_ErrorLog" has no attribute
"__iter__" (not iterable)  [attr-defined]
                for error in xsd.error_log:
                             ^~~~~~~~~~~~~
```

xref: https://github.com/galaxyproject/galaxy/pull/17081/files#r1490662640
lxml-stubs/etree.pyi Outdated Show resolved Hide resolved
Comment on lines 583 to 584
class _ErrorLog:
def __iter__(self) -> Iterator["_LogEntry"]: ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually not _ErrorLog that's iterable but its base class. Also, again, there are lots of public attributes and methods missing here. It's best to add all of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think I've added all the public attributes/properties/methods listed at https://lxml.de/apidoc/lxml.etree.html for _LogEntry, _ErrorLog and its parent classes. Let me know if I've missed some.

@scoder scoder merged commit 6832d61 into lxml:master Jun 4, 2024
6 checks passed
@scoder
Copy link
Member

scoder commented Jun 4, 2024

Thanks

@nsoranzo nsoranzo deleted the _ErrorLog_iterable branch June 4, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants