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.
Coverage: 100.0%. Remained the same when pulling c53e593ee01ed4f8df3ad69a73b0f8b7e9909101 on DeviousStoat:fix-to-dict into e02179b93cc5ccbda6e2b9ee8d98018ab616e617 on dgilland:develop.
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 builtindict
and the iterable case implemented in this library.