Skip to content

asyncio.gather API consistency with stdlib #1212

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

Merged
merged 2 commits into from
Jul 30, 2021
Merged

asyncio.gather API consistency with stdlib #1212

merged 2 commits into from
Jul 30, 2021

Conversation

MapleCCC
Copy link
Contributor

Intended as a drop-in replacement of the stdlib asyncio.gather(), it would be much reasonable if the function interface is consistent with that of asyncio.gather() as well.

It also ensures that our interface doesn't violate the least-surprising principle. It would have been surprising and frustrating for a user to wanting to use tqdm_asyncio.gather() as a drop-in replacement to the stdlib asyncio.gather() but ending up being bitten by the trivial inconsistency.

…cio.gather`

Intended as a drop-in replacement of the stdlib `asyncio.gather()`, it would be much reasonable if the function interface is consistent with that of `asyncio.gather()` as well.

It also ensures that our interface doesn't violate the least-surprising principle. It would have been surprising and frustrating for a user to wanting to use `tqdm_asyncio.gather()` as drop-in replacement to the stdlib `asyncio.gather()` but ending up being bitten by the trivial inconsistency.
@MapleCCC MapleCCC requested a review from casperdcl as a code owner July 29, 2021 00:01
@casperdcl casperdcl added c1-quick 🕐 Complexity low p0-bug-critical ☢ Exception rasing submodule ⊂ Periphery/subclasses labels Jul 29, 2021
@casperdcl casperdcl added this to the Non-breaking milestone Jul 29, 2021
@codecov
Copy link

codecov bot commented Jul 29, 2021

Codecov Report

Merging #1212 (a93aabc) into master (d986637) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1212   +/-   ##
=======================================
  Coverage   89.88%   89.88%           
=======================================
  Files          26       26           
  Lines        1721     1721           
  Branches      286      286           
=======================================
  Hits         1547     1547           
  Misses        128      128           
  Partials       46       46           

@casperdcl
Copy link
Member

casperdcl commented Jul 29, 2021

doesn't look like tests are passing... https://github.com/tqdm/tqdm/pull/1212/checks?check_run_id=3191178338

@MapleCCC
Copy link
Contributor Author

Yeah, I forgot to update the unit test as well. It should be fixed now.

@casperdcl casperdcl changed the base branch from master to devel July 30, 2021 20:31
@casperdcl casperdcl changed the title Make tqdm_asyncio.gather interface consistent with the stdlib asyncio.gather asyncio.gather API consistency with stdlib Jul 30, 2021
@casperdcl casperdcl merged commit 223561a into tqdm:devel Jul 30, 2021
@casperdcl casperdcl added the to-merge ↰ Imminent label Jul 30, 2021
@casperdcl
Copy link
Member

casperdcl commented Jul 30, 2021

Thanks! Probably will break some workflows next release (TypeError: object generator can't be used in 'await' expression) but does look necessary...

-await gather(list(map(double, range(30))))
+await gather(*map(double, range(30)))

@casperdcl casperdcl mentioned this pull request Jul 30, 2021
@MapleCCC MapleCCC deleted the patch-1 branch July 31, 2021 22:16
@MapleCCC
Copy link
Contributor Author

Considering that this PR introduces a backward incompatible change, shouldn't we make it into a future major release, as dictated by the semantic versioning spec tqdm follows?

MapleCCC added a commit to MapleCCC/QuickFund that referenced this pull request Aug 1, 2021
@casperdcl
Copy link
Member

I thought about it... technically breaking semver a bit but since 1. it's a submod and 2. fairly recently introduced so probably not that many users, I felt like sneaking it in a minor version bump may be better.

That being said, v5 really is overdue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c1-quick 🕐 Complexity low p0-bug-critical ☢ Exception rasing submodule ⊂ Periphery/subclasses to-merge ↰ Imminent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants