home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 525240363

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/3268#issuecomment-525240363 https://api.github.com/repos/pydata/xarray/issues/3268 525240363 MDEyOklzc3VlQ29tbWVudDUyNTI0MDM2Mw== 6213168 2019-08-27T10:24:38Z 2019-08-27T10:24:38Z MEMBER

Demonstation on the circular reference issue: ```python import gc import weakref import xarray

class C: pass

@xarray.register_dataset_accessor('foo') class Foo: def init(self, obj): self.obj = obj

ds = xarray.Dataset() w = weakref.ref(ds) print("No accessor, in scope:", w() is not None) del ds print("No accessor, descoped:", w() is not None)

ds = xarray.Dataset() ds.foo w = weakref.ref(ds) print("with accessor, in scope:", w() is not None) del ds print("with accessor, descoped:", w() is not None) gc.collect() print("with accessor, after gc pass:", w() is not None) Output: No accessor, in scope: True No accessor, descoped: False with accessor, in scope: True with accessor, descoped: True with accessor, after gc pass: False ```

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