home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 490824656

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/2292#issuecomment-490824656 https://api.github.com/repos/pydata/xarray/issues/2292 490824656 MDEyOklzc3VlQ29tbWVudDQ5MDgyNDY1Ng== 47244312 2019-05-09T09:13:22Z 2019-05-09T09:13:22Z CONTRIBUTOR

A possible way out would be to open a PEP for "and" and "not" operators in the typing module. That way we could define a "variable-name-like" type and use it throughout the module:

xarray.utils: from typing import AllOf, Hashable, NoneOf VarName = AllOf[Hashable, NoneOf[None, tuple]] Elsewhere: from .utils import VarName def f(x: Union[VarName, Sequence[VarName], None]): if x is None: x = [DEFAULT] elif isinstance(x, VarName): x = [x] elif not isinstance(x, Sequence): raise TypeError('x: expected hashable or sequence of hashables)

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