issue_comments: 798793062
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-798793062 | https://api.github.com/repos/pydata/xarray/issues/4904 | 798793062 | MDEyOklzc3VlQ29tbWVudDc5ODc5MzA2Mg== | 32801740 | 2021-03-13T22:07:41Z | 2021-03-13T22:07:41Z | CONTRIBUTOR |
thanks!
It takes precedence only during type checking as the source for static type information. The generated
There seem to be quite some open issues here with no indication they currently are actively working on fixing them. I am not using PyCharm myself, but as it is widely used I would also expect quite some xarray users to be using it.
For these unary ops with simple type hints if would probably work but for most other methods with multiple overloads the typing ecosystem is not yet mature enough. In this issue I have commented on it. I hope one day we will be able to refactor this into some generic parent classes (one for unary ops, one for binary (and reflexive) ops and one for inplace ops) from which we can inherit. Using a generic parent class only for the unary ops and not for the others would make the script more complicated. For now, I'd say this somewhat low-tech solution gets the job done.
Unfortunately we have to define them both ways for typing purposes. This comment in Note: in some of the overloads below the return value in reality is NotImplemented,which cannot accurately be expressed with type hints,e.g. Literal[NotImplemented]or type(NotImplemented) are not allowed and NoReturn has a different meaning.In such cases we are lending the type checkers a hand by specifying the return typeof the corresponding reflexive method on
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
807764700 |