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

ENH: Add a cycler-specific chain function. #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danielballan
Copy link
Contributor

The discussion in #1 introduced a concat method. For combining more than two cyclers, it would be convenient to assign an infix operator for concatenation, but there is no obvious candidate --- as has already been discussed.

What about a top-level chain method, akin to itertools.chain, but one that fails immediately if keys don't match? Is this useful bloat or a fair solution for multiple concatenation, laking a suitable operator?

I'm happy to see this tossed out if the answer is, "sorry, this is bloat." But I'll leave it here for discussion. If people like it, I'll add tests.

@tacaswell tacaswell added this to the v1.0 milestone Feb 16, 2016
@tacaswell
Copy link
Member

I am 30/70 on this. More open to changing the concat function to take 2 or more Cyclers.

I like the analogy, but the same-named-but-special top level function floating around can get confusing.

@@ -549,3 +549,28 @@ def _cycler(label, itr):
itr = (v[lab] for v in itr)

return Cycler._from_iter(label, itr)


def chain(*args):
Copy link
Member

Choose a reason for hiding this comment

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

Can we rename this to cychain?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Would that change your 30/70 feeling on putting it in?

Copy link
Member

Choose a reason for hiding this comment

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

I think I would merge it with this change.

@QuLogic QuLogic modified the milestones: v0.10, v1.0 Oct 25, 2021
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.

3 participants