home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 849183582

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/4896#issuecomment-849183582 https://api.github.com/repos/pydata/xarray/issues/4896 849183582 MDEyOklzc3VlQ29tbWVudDg0OTE4MzU4Mg== 14808389 2021-05-26T23:22:38Z 2021-05-27T00:09:15Z MEMBER

there's two remaining issues: should we use a namedtuple / a dataclass for Context instead of the custom class? We basically want a struct without methods (for now?).

Also, how do we best construct that object without a lot of overhead? We need to get at least the function name, but if we pass that manually it's one more place to update when renaming something (not that we do that very often). Using inspect is possible but might be too complicated: python In [5]: import inspect ...: ...: def current_function_name(): ...: frame = inspect.currentframe() ...: try: ...: caller = frame.f_back ...: name = caller.f_code.co_name ...: finally: ...: del frame ...: del caller ...: ...: return name ...: ...: def func(): ...: print(current_function_name()) ...: ...: def another_func(): ...: print(current_function_name()) ...: ...: class A: ...: def method(self): ...: print(current_function_name()) ...: ...: f = func ...: ...: func() ...: another_func() ...: f() ...: ...: a = A() ...: a.method() func another_func func method With this we can only get the name of the definition so this might break for injected methods, but I guess for injected methods it would be difficult to manually pass the function name, anyways.

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