home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1132105430

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/issues/6142#issuecomment-1132105430 https://api.github.com/repos/pydata/xarray/issues/6142 1132105430 IC_kwDOAMm_X85Deo7W 43316012 2022-05-19T19:14:41Z 2022-05-19T19:20:28Z COLLABORATOR

Only remotely related to this issue, but would it help to type the dimension (or variable names etc) Mappings with covariant Hashable keys to prevent the issue that {"a":1} is incompatible with Mapping[Hashable, Any]?

Something like: python Hashable_co = TypeVar("Hashable_co", bound=Hashable, covariant=True) Mapping[Hashable_co, Any]

Same for lists etc. (Or use Sequences which are already covariant, as opposed to lists)

I am not an expert on variance in types and don't know if this would break things, but at least in my tests mypy did not complain when using dict[str, str].

See https://mypy-play.net/?mypy=latest&python=3.10&gist=b2c27a5ca4aad9e8ce63cd74dc4032b0

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  1094725752
Powered by Datasette · Queries took 1.712ms · About: xarray-datasette