issues: 1084220684
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1084220684 | PR_kwDOAMm_X84wDPg5 | 6086 | Type protocol for internal variable mapping | 35968931 | closed | 0 | 9 | 2021-12-19T23:32:04Z | 2023-12-06T17:20:48Z | 2023-12-06T17:19:30Z | MEMBER | 1 | pydata/xarray/pulls/6086 | In #5961 and #6083 I've been experimenting extending I've been writing out new storage class implementations in those PRs, but on Friday @shoyer suggested that I could instead simply alter the allowed type for The idea is to define a protocol in xarray which specifies the structural subtyping behaviour of any custom variable storage class that I might want to set as In practice this means writing a protocol which describes the type behaviour of all the methods on So far I've written out a 1) The typing behaviour of overloaded methods, specifically
2) Making functions which expect a
3) I'm expecting to get a runtime problem whenever we Once that passes mypy I will write a test that checks that if I define my own custom variable storage class I can @max-sixty this is entirely a typing challenge, so I'm tagging you in case you're interested :)
EDIT: Also using |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6086/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | pull |