issue_comments: 779404893
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/pydata/xarray/pull/4904#issuecomment-779404893 | https://api.github.com/repos/pydata/xarray/issues/4904 | 779404893 | MDEyOklzc3VlQ29tbWVudDc3OTQwNDg5Mw== | 32801740 | 2021-02-15T19:10:56Z | 2021-02-15T19:10:56Z | CONTRIBUTOR |
I agree. Both PRs you mention would be nice to see merged. I was still using numpy 1.19.
I usually prefer inline type hints. The motivation for stub files was mostly because all other approaches I tried where not sufficient, see my comment in #4054. It turns out we might not even need a stub file, see my reply above to max-sixty's comments.
That is correct. It can currently be considered a mixin class during type checking and a no-op at compile and runtime. If I can get max-sixty's suggestion to work, then we would quite literally be following up on that TODO by using mixin classes instead of the unintuitive "inject" functions.
Those are mypy warning for overlapping overload signatures with incompatible return types. In practice it is not a problem as the first matching overload gets picked. One reason for overlapping is that with numpy <=1.20
Agreed. What name would work in this case? Something like
I think it would be nice to allow some simple kinds of subclassing (some (many?) methods already preserve the subclass in the return value but the type hint mentions the base class as return type). The particular use case I have in mind involves having a custom Accessor registered with ``` import xarray as xr if TYPE_CHECKING: class Dataset(xr.Dataset): myaccessor: MyAccessor else: Dataset = xr.Dataset # note that at runtime we just work with xr.Dataset ds = Dataset(...) ds2 = (ds + 1).sel(x=1) # some operations (ideally preserving subclass!) In the line below I would like my IDE to be able to show me the docstrings,methods signatures and typing information for
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
807764700 |