viralogic / py-enumerable

A Python module used for interacting with collections of objects using LINQ syntax
MIT License
187 stars 24 forks source link

reverse() not reverse #79

Open pinter-adam opened 1 year ago

pinter-adam commented 1 year ago

Looks like in the latest (1.4) release the .reverse() not working as expected, and because of this is the last() and the last_or_default() functions do not return the desired value. Below is an example.

>>> from py_linq import Enumerable
>>> e = Enumerable([1,2,3])
>>> print(e)
[1, 2, 3]
>>> print(e.reverse()) 
[1, 2, 3]
>>> print(e.last())
1