viralogic / py-enumerable

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

add index_of, last_index_of, and for_each #71

Open mzhukovs opened 2 years ago

mzhukovs commented 2 years ago

PR for #70 for your consideration

viralogic commented 2 years ago

@mzhukovs

I appreciate the PR. I apologise, but haven't had a chance to look at it yet. I will review it and get back to you with some comments as soon as I can.

mzhukovs commented 2 years ago

Think there needs to be a bit of a refactoring to make order consistent, otherwise implementing index_of, or even the existing implementation of first() becomes a moot point.

e.g. first() isn't deterministic right now, call it 2x in a row on the same Enumerable and you'll get 2 different outputs.

viralogic commented 2 years ago

I agree with you here

On Wed., Jan. 12, 2022, 10:43 p.m. Mark Zhukovsky, @.***> wrote:

Think there needs to be a bit of a refactoring to make order consistent, otherwise implementing index_of, or even the existing implementation of first() becomes a moot point.

e.g. first() isn't deterministic right now, call it 2x in a row on the same Enumerable and you'll get 2 different outputs.

— Reply to this email directly, view it on GitHub https://github.com/viralogic/py-enumerable/pull/71#issuecomment-1011814821, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOO5MFS6O2JCRFOKCZ6JA3UVZRBDANCNFSM5GDJXGKA . You are receiving this because you commented.Message ID: @.***>

viralogic commented 2 years ago

@mzhukovs

Again, apologies. New job is keeping me busy, but I haven't forgotten about this. Just as an FYI, I have created issue #73 to deal with the issue you have raised and plan on fixing it soon.

Are you ok with both of us having a look at this PR once I get the fix for Issue #73 into development?

mzhukovs commented 1 year ago

@viralogic definitely - would be great to circle back!