Skip to content

Conversation

@bbayles
Copy link
Collaborator

@bbayles bbayles commented Aug 20, 2024

This PR implements @rhettinger's suggestion in issue 902.

Closes #902

self.assertTrue(mi.all_equal('4٤໔4৪', key=int))
self.assertFalse(mi.all_equal('Abc', key=str.casefold))

@patch('more_itertools.recipes.groupby', autospec=True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like the mock object's call_count should be able to be used here, but I couldn't get it to actually work.

@bbayles bbayles merged commit 35f8e41 into master Aug 21, 2024
@bbayles bbayles deleted the issue-902 branch August 21, 2024 16:37
github-merge-queue bot referenced this pull request in canonical/charmcraft Sep 6, 2024
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[more-itertools](https://redirect.github.com/more-itertools/more-itertools)
| `==10.4.0` -> `==10.5.0` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/more-itertools/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/more-itertools/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/more-itertools/10.4.0/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/more-itertools/10.4.0/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>more-itertools/more-itertools (more-itertools)</summary>

###
[`v10.5.0`](https://redirect.github.com/more-itertools/more-itertools/releases/tag/v10.5.0)

[Compare
Source](https://redirect.github.com/more-itertools/more-itertools/compare/v10.4.0...v10.5.0)

#### What's Changed

- Optimize all_equal recipe by
[@&#8203;bbayles](https://redirect.github.com/bbayles) in
[https://github.com/more-itertools/more-itertools/pull/899](https://redirect.github.com/more-itertools/more-itertools/pull/899)
- Reduce groupby.**next** calls in all_equal by
[@&#8203;bbayles](https://redirect.github.com/bbayles) in
[https://github.com/more-itertools/more-itertools/pull/903](https://redirect.github.com/more-itertools/more-itertools/pull/903)
- Fix types.UnionType by
[@&#8203;bbayles](https://redirect.github.com/bbayles) in
[https://github.com/more-itertools/more-itertools/pull/905](https://redirect.github.com/more-itertools/more-itertools/pull/905)
- Version 10.5.0 by
[@&#8203;bbayles](https://redirect.github.com/bbayles) in
[https://github.com/more-itertools/more-itertools/pull/906](https://redirect.github.com/more-itertools/more-itertools/pull/906)

**Full Changelog**:
more-itertools/more-itertools@v10.4.0...v10.5.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "every weekend" in timezone Etc/UTC,
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/canonical/charmcraft).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
lengau referenced this pull request in canonical/charmcraft Sep 8, 2024
…#1885)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[more-itertools](https://redirect.github.com/more-itertools/more-itertools)
| `==10.4.0` -> `==10.5.0` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/more-itertools/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/more-itertools/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/more-itertools/10.4.0/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/more-itertools/10.4.0/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>more-itertools/more-itertools (more-itertools)</summary>

###
[`v10.5.0`](https://redirect.github.com/more-itertools/more-itertools/releases/tag/v10.5.0)

[Compare
Source](https://redirect.github.com/more-itertools/more-itertools/compare/v10.4.0...v10.5.0)

#### What's Changed

- Optimize all_equal recipe by
[@&#8203;bbayles](https://redirect.github.com/bbayles) in
[https://github.com/more-itertools/more-itertools/pull/899](https://redirect.github.com/more-itertools/more-itertools/pull/899)
- Reduce groupby.**next** calls in all_equal by
[@&#8203;bbayles](https://redirect.github.com/bbayles) in
[https://github.com/more-itertools/more-itertools/pull/903](https://redirect.github.com/more-itertools/more-itertools/pull/903)
- Fix types.UnionType by
[@&#8203;bbayles](https://redirect.github.com/bbayles) in
[https://github.com/more-itertools/more-itertools/pull/905](https://redirect.github.com/more-itertools/more-itertools/pull/905)
- Version 10.5.0 by
[@&#8203;bbayles](https://redirect.github.com/bbayles) in
[https://github.com/more-itertools/more-itertools/pull/906](https://redirect.github.com/more-itertools/more-itertools/pull/906)

**Full Changelog**:
more-itertools/more-itertools@v10.4.0...v10.5.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "every weekend" in timezone Etc/UTC,
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/canonical/charmcraft).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6ImhvdGZpeC8zLjIiLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
lengau referenced this pull request in canonical/charmcraft Sep 9, 2024
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[more-itertools](https://redirect.github.com/more-itertools/more-itertools)
| `==10.4.0` -> `==10.5.0` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/more-itertools/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/more-itertools/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/more-itertools/10.4.0/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/more-itertools/10.4.0/10.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>more-itertools/more-itertools (more-itertools)</summary>

###
[`v10.5.0`](https://redirect.github.com/more-itertools/more-itertools/releases/tag/v10.5.0)

[Compare
Source](https://redirect.github.com/more-itertools/more-itertools/compare/v10.4.0...v10.5.0)

#### What's Changed

- Optimize all_equal recipe by
[@&#8203;bbayles](https://redirect.github.com/bbayles) in
[https://github.com/more-itertools/more-itertools/pull/899](https://redirect.github.com/more-itertools/more-itertools/pull/899)
- Reduce groupby.**next** calls in all_equal by
[@&#8203;bbayles](https://redirect.github.com/bbayles) in
[https://github.com/more-itertools/more-itertools/pull/903](https://redirect.github.com/more-itertools/more-itertools/pull/903)
- Fix types.UnionType by
[@&#8203;bbayles](https://redirect.github.com/bbayles) in
[https://github.com/more-itertools/more-itertools/pull/905](https://redirect.github.com/more-itertools/more-itertools/pull/905)
- Version 10.5.0 by
[@&#8203;bbayles](https://redirect.github.com/bbayles) in
[https://github.com/more-itertools/more-itertools/pull/906](https://redirect.github.com/more-itertools/more-itertools/pull/906)

**Full Changelog**:
more-itertools/more-itertools@v10.4.0...v10.5.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "every weekend" in timezone Etc/UTC,
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/canonical/charmcraft).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

One more nit on all_equal()

3 participants