pie icon indicating copy to clipboard operation
pie copied to clipboard

remove element by value and by index

Open ismlsmile opened this issue 2 years ago • 1 comments

Could I remove an element by its value and index ?

ismlsmile avatar Aug 09 '22 03:08 ismlsmile

I'm not sure if you mean you wish to remove an element when its matches an index and it's value, or if you mean you want independent processes to do either.

There is no function for removing by index (although, there should be). If you want to remove by value, you can use Filter or FilterNot.

elliotchance avatar Aug 14 '22 13:08 elliotchance

I am ready to implement a function for removing by index. I think issue https://github.com/elliotchance/pie/issues/171 is related to this one. @elliotchance approve or correct me please and I'll do that as soon as I can.

chocolacula avatar Jun 08 '23 08:06 chocolacula

Go for it. The linked diff was against pie v1 which I'm not supporting anymore.

elliotchance avatar Jun 08 '23 13:06 elliotchance

Added in https://github.com/elliotchance/pie/pull/194

chocolacula avatar Jun 08 '23 18:06 chocolacula

@elliotchance perhaps, the issue could be closed because removing by index was implemented, and filtering function already exists.

chocolacula avatar Feb 06 '24 14:02 chocolacula

@chocolacula yeah, good point

elliotchance avatar Feb 06 '24 19:02 elliotchance