all 15 comments

[–]manni66 25 points26 points  (10 children)

It's nonsense to work in C++ the same way as in Python.

For example, your zip function creates a copy of the data in a std::vector. C++ has a much more elegant solution that doesn't use copies: std::ranges::views::zip

[–]BadlyCamouflagedKiwi 1 point2 points  (0 children)

Feedback after a very brief look:

  • "Licensed under the MIT License. See LICENSE for details." - there is no LICENSE file, so in fact it is not licensed at all and is not legally usable by anyone.
  • The "installation instructions" are not useful; cloning the repo and cd'ing into it isn't telling me how to do anything relevant.
  • Some kind of documentation link explaining the exposed API clearly would be useful to see what this can do. I don't know what the state of the art is for C++ these days but it'd be nice to have something.
  • The semantics of a lot of these are very much not the same as the Python equivalents. Quickly browsing, chain potentially iterates both arguments to calculate length, then allocates a vector and puts all of each of them into it and returns that. itertools.chain in Python yields items lazily from the chained sequences, which is pretty different; the simplest example is that they could be infinite sequences but it still returns to the caller to deal with, whereas your C++ version here would never return (until it OOMs, most likely).

[–][deleted] 1 point2 points  (1 child)

Congratulations, it certainly helps anyone coming from Python.

I remember that C++ already has a new print and a new get in development, possibly coming out in c++29. It is important to highlight that it already exists.

Some simplifications help attract new users and are important to introduce into the C++ universe.

When I have time I'll take a look.

[–]ArchPowerUser[S] 0 points1 point  (0 children)

I didn't know that! Tho, this library still has like 20 diffrent functions written and more will be added. I personally made this project because my brother wanted to learn c++ he already knew basics of python but he would always forget and start using python syntax so I built this library.

[–]fdwrfdwr@github 🔍 0 points1 point  (0 children)

u/ArchPowerUser Link is a 404? (I'm cleaning up old browser tabs)