You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you very much for this very useful python package. Unfortunately mypy is very confused by property aliases such as
@propertydefreferences(self) ->"IterableList[Reference]":
"""A list of :class:`~git.refs.reference.Reference` objects representing tags, heads and remote references. :return: ``git.IterableList(Reference, ...)`` """returnReference.list_items(self)
# Alias for references.refs=references
test.py:4: error: "Callable[[], IterableList[Head]]" has no attribute "__iter__" (not iterable) [attr-defined]
Found 1 error in 1 file (checked 1 source file)
I am not aware of any fix that would not uglify the code here, and that mypy issue doesn’t seem likely to see improvement in the near future. This is sad, but doing all the work to add type annotations and still having users facing incomprehensible error messages in perfectly legitimate code is also sad.
Could you please tell me whether you would welcome a PR “fixing” this?
The text was updated successfully, but these errors were encountered:
Thanks for reporting! Yes, please feel free to submit a PR with a fix, as long as it's not done by a breaking change in the current API.
If the API needs to change, an alternative one to the what already exists can be provided. Maybe, and this is my hope, the typing itself can be improved.
Thank you very much for this very useful python package. Unfortunately mypy is very confused by property aliases such as
that can be found in
git/repo/base.py
or the analogous aliasbranches
forheads
. See python/mypy#6700You can reproduce the issue with the following
test.py
:about which
mypy
says:I am not aware of any fix that would not uglify the code here, and that mypy issue doesn’t seem likely to see improvement in the near future. This is sad, but doing all the work to add type annotations and still having users facing incomprehensible error messages in perfectly legitimate code is also sad.
Could you please tell me whether you would welcome a PR “fixing” this?
The text was updated successfully, but these errors were encountered: