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

Added TaskGroup.start_soon() and changed spawn() back into a coroutine function #254

Merged
merged 6 commits into from
Apr 9, 2021

Conversation

agronholm
Copy link
Owner

One more step towards a trio-like API.

@agronholm agronholm requested a review from smurfix April 6, 2021 20:45
@agronholm agronholm marked this pull request as draft April 6, 2021 20:49
@agronholm
Copy link
Owner Author

This will break code written against the release candidates. The fix should be easy though.

@agronholm agronholm marked this pull request as ready for review April 6, 2021 22:13
@agronholm
Copy link
Owner Author

I'm only just wondering if we could emit deprecation warnings from the renamed methods. How would AnyIO 2/3 compatible code look like?

@smurfix
Copy link
Collaborator

smurfix commented Apr 7, 2021

Why doesn't spawn emit a DeprecationWarning?

@agronholm
Copy link
Owner Author

I'm trying to give library developers a way to use AnyIO 2.x and 3.x in the same code base without running into deprecation warnings. With free functions you could just conditionally import them but with methods it's not as simple. Can you suggest a solution?

@smurfix
Copy link
Collaborator

smurfix commented Apr 7, 2021

Hmm. Tricky, sounds like "defer adding a deprecation warning to spawn until anyio 3.1" is the best (or at least easiest-to-implement) idea here.

@agronholm
Copy link
Owner Author

I made them emit deprecation warnings after all, and pointed out that cross-compatible code could simply suppress the deprecation warnings. Good enough?

@smurfix
Copy link
Collaborator

smurfix commented Apr 9, 2021

Perfect.

@agronholm agronholm merged commit 9a17132 into master Apr 9, 2021
@agronholm agronholm deleted the start_soon branch April 9, 2021 11:54
@agronholm
Copy link
Owner Author

Thanks for the review!

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.

None yet

2 participants