Use property decorator to support typing#2015
Use property decorator to support typing#2015Byron merged 1 commit intogitpython-developers:mainfrom Andrej730:main
Conversation
Byron
left a comment
There was a problem hiding this comment.
Thanks a lot, that's a nice improvement, making the implementation more idiomatic as well.
Once CI passes this can be merged.
|
Comparing That doesn't necessarily mean that this shouldn't be merged. GitPython is not currently |
|
Fixed the failing lint. I guess some of those new mypy errors caused by getters not returning permissive |
|
I have to leave the decision to @EliahKagan as well. Since CI can't catch anything I'd be quite confident that this is OK, and if not somebody might be annoyed enough to help with the fix. Since typing is 'tacked on', maybe there is no way to keep it all working anyway, as tools change, and the language is too dynamic as well. |
|
I think it is definitely better to merge this than to let it wait indefinitely. There might be an improvement that can be made, but I'm not sure. I also don't know when I would get to looking into it further. I have no objection to this being merged at any time; it can always be revisited. |
It seems this type of properties are not supported by type checkers (mypy, pyright) and using
propertydecorator fixes the issue.See example below.