Code Monkey home page Code Monkey logo

Comments (8)

bluss avatar bluss commented on June 2, 2024

I guess you're right about that, most implementations do not make sense as double ended. You can of course run into this problem in other places, like in a regular .iter().map() too. I'm not sure what the final decision will be. After all, .map() is double ended.

from itertools.

Stebalien avatar Stebalien commented on June 2, 2024

That's... odd. I've submitted a bug to discuss it (rust-lang/rust#30632). It kind of makes sense because map (and filter) are generally pure functions but this behavior should, at least, be noted.

However, this case is pretty clear; RepeatCall always produces an infinite sequence and infinite sequences only have one end.

from itertools.

bluss avatar bluss commented on June 2, 2024

I disagree actually, infinite sequences can have two ends (For example .cycle()). Maybe cycle is a bad argument, since I wrote it 😄

from itertools.

bluss avatar bluss commented on June 2, 2024

Oh no, cycle is not double ended! My evil plans,... Ok I guess I managed to scare you there by mistake.

from itertools.

bluss avatar bluss commented on June 2, 2024

On the whole, sideeffectful iterators can always cause trouble like this. I'm leaning towards wontfixing this bug for this reason, it has use cases where double endedness is useful.

from itertools.

Stebalien avatar Stebalien commented on June 2, 2024

Infinite sequences have one end.

-- ZFC

Yes, some sequences can go backwards from the starting point but that's not double ended, it's no-ended (doubly infinite).

from itertools.

bluss avatar bluss commented on June 2, 2024

I thought this issue could stay open until we make a decision (0.5 is next breaking change opportunity).

Currently I lean WONTFIX.

from itertools.

bluss avatar bluss commented on June 2, 2024

In a crazy turn of events, I'm removing the DEI implementation in 0.5

from itertools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.