home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 617763273

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/3988#issuecomment-617763273 https://api.github.com/repos/pydata/xarray/issues/3988 617763273 MDEyOklzc3VlQ29tbWVudDYxNzc2MzI3Mw== 14808389 2020-04-22T12:58:18Z 2020-04-22T12:58:18Z MEMBER

there are a few of my questions / comments we can resolve by using something like ```python class UncachedAccessor: def init(self, accessor): self._accessor = accessor

def __get__(self, obj, cls):
    if obj is None:
        return self._accessor

    return self._accessor(obj)

```

The only disadvantage is that now pydoc (or help()) show the accessor as a class. That was already the case for str and dt, but plot was a function.

I think we could try to trick inspect.getmembers (which is used to decide which kind of output should be done), but that would require a lot of monkeypatching I'd rather not do.

pandas simply uses the same docstring for the class and __call__, which is not ideal but a lot simpler.

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