viralogic / py-enumerable

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

Consider add a method to_dict #63

Closed norsd closed 3 years ago

norsd commented 3 years ago

How about add a method to_dict to Enumerable like to_dict(lambda x: x=>key, lambeda x: x=>value)

viralogic commented 3 years ago

@norsd

Can you expand on what the inputs and outputs should be for this method? Is the result of this method a single dictionary, with the same number of keys as items in the collection? Are we just projecting a single property/field/key from each item in the collection? What are the lambda parameters for? Why do we need 2 lambda parameters?

Thanks,

Bruce