Skip to content

Commit

Permalink
Fix refcount
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Mar 28, 2024
1 parent 5681563 commit 3f16fb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py-polars/tests/unit/dataframe/test_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -1620,8 +1620,8 @@ def __repr__(self) -> str:
return f"foo({self.value})"

foos = [Foo(1), Foo(2), Foo(3)]
# I believe foos, stack, and sys.getrefcount have a ref
base_count = 3
# foos and sys.getrefcount have a reference.
base_count = 2
assert sys.getrefcount(foos[0]) == base_count

df = pl.DataFrame({"groups": [1, 1, 2], "a": foos})
Expand Down

0 comments on commit 3f16fb0

Please sign in to comment.