tomerfiliba / plumbum

Plumbum: Shell Combinators
https://plumbum.readthedocs.io
MIT License
2.78k stars 182 forks source link

Add type hints to abstractmethods of Path #646

Closed moskupols closed 1 year ago

moskupols commented 1 year ago

We are currently integrating pyright checks in our project. We found that generally pyright is great at inferring the return types by just looking at the source code of libraries. However for abstractmethods which only contain a docstring it assumes that the method is supposed to return None since there's no return statement. This minimal set of hints seems to help pyright figure out how plumbum paths work.

coveralls commented 1 year ago

Coverage Status

Coverage: 83.946%. Remained the same when pulling 45620b52fcad69e16d8514d99ebb535d64c597fd on moskupols:type-hint-return-path-abstractmethods into c03482b010115288bbe1e8167c121a897e8634fe on tomerfiliba:master.

henryiii commented 1 year ago

Thanks! Eventually I'd like to get more typing in. :)