Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid creating a reference cycle when calling Error.unwrap #29

Merged
merged 2 commits into from
Nov 16, 2020

Conversation

njsmith
Copy link
Member

@njsmith njsmith commented Nov 16, 2020

This avoids invoking the cycle collector as often; see

python-trio/trio#1770

for more details.

njsmith added a commit to njsmith/trio that referenced this pull request Nov 16, 2020
This avoids invoking the cycle collector as often; see

  python-trio/trio#1770

for more details.
@codecov
Copy link

codecov bot commented Nov 16, 2020

Codecov Report

Merging #29 (5a3b4e9) into master (0d0cfb0) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master       #29   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          213       227   +14     
  Branches        11        11           
=========================================
+ Hits           213       227   +14     
Impacted Files Coverage Δ
src/outcome/_impl.py 100.00% <100.00%> (ø)
tests/test_sync.py 100.00% <100.00%> (ø)

Copy link
Member

@belm0 belm0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think about adding a test case that checks the cycle count created by a sleep(0) (probably for CPython only)? Set the limit at or around the current observed value. Then we can tighten this as improvements are added, and have a chance at recognizing regressions early.

(moving comment to trio PR)

tests/test_sync.py Outdated Show resolved Hide resolved
tests/test_sync.py Outdated Show resolved Hide resolved
Co-authored-by: Dave Hirschfeld <dave.hirschfeld@gmail.com>
@njsmith
Copy link
Member Author

njsmith commented Nov 16, 2020

This is going to need admin permissions to do the actual merge, because I just switched the repo from travis-ci.org to travis-ci.com and the branch protection rules are temporarily messed up. But I know @belm0 uses "approve" to mean "please go ahead and self merge", so I guess I'll take that as permission to self-merge :-)

@belm0
Copy link
Member

belm0 commented Nov 16, 2020

worth a newsfragment?

njsmith added a commit to njsmith/outcome that referenced this pull request Nov 17, 2020
@njsmith
Copy link
Member Author

njsmith commented Nov 17, 2020

@belm0 yeah, newsfragment is fair, added in #30

belm0 pushed a commit to njsmith/trio that referenced this pull request Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants