trio icon indicating copy to clipboard operation
trio copied to clipboard

avoid holding a reference to exception and value in to_thread_run_sync

Open graingert opened this issue 8 months ago • 3 comments

graingert avatar Mar 21 '25 08:03 graingert

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00000%. Comparing base (0ea9328) to head (0987dc6).

Additional details and impacted files
@@               Coverage Diff               @@
##                 main        #3229   +/-   ##
===============================================
  Coverage   100.00000%   100.00000%           
===============================================
  Files             124          124           
  Lines           18779        18837   +58     
  Branches         1269         1270    +1     
===============================================
+ Hits            18779        18837   +58     
Files with missing lines Coverage Δ
src/trio/_core/_entry_queue.py 100.00000% <100.00000%> (ø)
src/trio/_core/_tests/test_run.py 100.00000% <ø> (ø)
src/trio/_core/_tests/tutil.py 100.00000% <100.00000%> (ø)
src/trio/_tests/test_threads.py 100.00000% <100.00000%> (ø)
src/trio/_threads.py 100.00000% <100.00000%> (ø)
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Mar 21 '25 08:03 codecov[bot]

This seems like just reimplementing outcome. If you need to copy, why not instantiate outcome.Value/Error directly? Only detail that's different is unwrap doesn't clear values, but we could just inline the implementation into the unwrap location? Or add unwrap_clear() or something.

oh yeah that's the plan, I want to get a proof of concept working first

graingert avatar Mar 21 '25 20:03 graingert

@TeamSpen210 https://github.com/python-trio/outcome/pull/45

graingert avatar Mar 22 '25 11:03 graingert