dgilland / pydash

The kitchen sink of Python utility libraries for doing "stuff" in a functional way. Based on the Lo-Dash Javascript library.
http://pydash.readthedocs.io
MIT License
1.28k stars 89 forks source link

update to_dict types #188

Closed DeviousStoat closed 1 year ago

DeviousStoat commented 1 year ago

https://github.com/dgilland/pydash/issues/187

I looked into this but I think there isn't a good way to check this if we want to support iterable. We would have to iterate over the iterable which wouldn't be very nice. Since it is a very rare edge case (happens only if it is a iterable of strings and all of them have exact length of 2) and it is the behaviour of the builtin dict class, maybe it is not worth supporting. What do you think?

This PR just adds the other types for to_dict which are supported by builtin dict and the iterable case implemented in this library.

coveralls commented 1 year ago

Coverage Status

Coverage: 100.0%. Remained the same when pulling c53e593ee01ed4f8df3ad69a73b0f8b7e9909101 on DeviousStoat:fix-to-dict into e02179b93cc5ccbda6e2b9ee8d98018ab616e617 on dgilland:develop.