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 to_dict functionality #66

Closed steveberdy closed 3 years ago

steveberdy commented 3 years ago

Added a to_dict method with the functionality of .NET's System.Linq.Enumerable.ToDictionary method. One parameter is for a lambda that assigns keys according to the items in the collection, while the other parameter is an optional lambda that assigns values to the dictionary according to the items in the collection. Values default to the individual items in the collection, while keys must be specified. Docs were updated and tests were added as well.

Closes #63

steveberdy commented 3 years ago

Hi @viralogic. Could you please run workflows for this PR? Thanks.

steveberdy commented 3 years ago

@viralogic I had deleted the fork, so I can't add any more commits to this PR even if I recreate the fork (which I did). Maybe we can merge this PR and then I'll follow up immediately with a new one that renames to-dict to to-dictionary. Will that be fine?

steveberdy commented 3 years ago

Here is my branch where I made the most recent changes and renamed the method: steveberdy:dict-branch

viralogic commented 3 years ago

@steveberdy I have merged your PR so that you can proceed with the renaming.

steveberdy commented 3 years ago

Thanks

steveberdy commented 3 years ago

@viralogic see #67 for the latest PR