trio icon indicating copy to clipboard operation
trio copied to clipboard

Make ``start_soon`` a protocol.

Open Fuyukai opened this issue 2 years ago • 4 comments

Don't care for bikeshedding over the name of the protocol. The definition of start_soon is directly copied from Nursery.

I would've liked Nursery to explicitly implement TaskSpawner but it can't due to metaclass clashing.

Fuyukai avatar Dec 19 '23 16:12 Fuyukai

Codecov Report

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

Comparison is base (d4ce2f9) 99.49% compared to head (47ed6c9) 99.49%. Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2907   +/-   ##
=======================================
  Coverage   99.49%   99.49%           
=======================================
  Files         115      115           
  Lines       17704    17704           
  Branches     3158     3158           
=======================================
  Hits        17615    17615           
  Misses         70       70           
  Partials       19       19           
Files Coverage Δ
src/trio/_abc.py 100.00% <100.00%> (ø)
src/trio/_highlevel_open_tcp_listeners.py 100.00% <ø> (ø)
src/trio/_highlevel_serve_listeners.py 100.00% <100.00%> (ø)
src/trio/_highlevel_ssl_helpers.py 100.00% <ø> (ø)
src/trio/abc.py 100.00% <ø> (ø)

codecov[bot] avatar Dec 19 '23 16:12 codecov[bot]

I'm not changing the name.

Fuyukai avatar Dec 27 '23 07:12 Fuyukai

Hi, just a bump! re: my last comment I still can't think of normal usage that requires this to be exported.

A5rocks avatar Jan 10 '24 03:01 A5rocks

does this really need to be exported? I imagine any normal usage of this will just have the concrete other nursery as a type hint:

I already changed type hints for listeners to accept this, so yes, it does.

I'll get around to fixing the docstring at some point soon.

Fuyukai avatar Jan 10 '24 13:01 Fuyukai

Yeah, I don't really care to do this anymore. I'll just close it.

Fuyukai avatar Apr 12 '24 23:04 Fuyukai