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

Subsets(0) should return an empty set #645

Closed
Orace opened this issue Nov 5, 2019 · 1 comment · Fixed by #646
Closed

Subsets(0) should return an empty set #645

Orace opened this issue Nov 5, 2019 · 1 comment · Fixed by #646

Comments

@Orace
Copy link
Contributor

Orace commented Nov 5, 2019

The 0-Subsets of a sequence should be a one item sequence, and this item should be an empty list.
Indeed there is always one subset of length 0 : the empty set.

  Enumerable.Range(1, 4).Subsets(0);  // [] instead of [[]]

It returns an empty sequence instead.

A call to Subsets() return a sequence that contains an empty list, as expected.

Orace added a commit to Orace/MoreLINQ that referenced this issue Nov 5, 2019
@atifaziz atifaziz added this to the vNext milestone Dec 27, 2019
@atifaziz
Copy link
Member

Thanks for reporting this. Unfortunately, since this is a breaking change and Subsets has been around for a long time, I am currently inclined to defer this to the next major version update.

@atifaziz atifaziz changed the title bug in KSubset with k = 0 bug in Subsets when k = 0 Dec 27, 2019
@atifaziz atifaziz changed the title bug in Subsets when k = 0 Bug in Subsets when k = 0 Dec 27, 2019
@atifaziz atifaziz changed the title Bug in Subsets when k = 0 Subsets(0) should return an empty set Dec 27, 2019
@atifaziz atifaziz modified the milestones: vNext, 4.0 Oct 20, 2023
@atifaziz atifaziz changed the title Subsets(0) should return an empty set Subsets(0) should return an empty set Oct 20, 2023
@atifaziz atifaziz linked a pull request Oct 20, 2023 that will close this issue
atifaziz added a commit that referenced this issue Oct 21, 2023
This is a squashed merge of PR #646 that fixes #645.

---------

Co-authored-by: Atif Aziz <code@raboof.com>
julienasp pushed a commit to julienasp/MoreLINQ that referenced this issue Nov 14, 2023
This is a squashed merge of PR morelinq#646 that fixes morelinq#645.

---------

Co-authored-by: Atif Aziz <code@raboof.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants