gmr / flatdict

Python module for interacting with nested dicts as a single level dict with delimited keys.
https://flatdict.readthedocs.io
BSD 3-Clause "New" or "Revised" License
111 stars 32 forks source link

Add support to not flatten lists #12

Closed rj-jesus closed 6 years ago

rj-jesus commented 7 years ago

My use case didn't require lists to be flattened.

As such, and in case others also don't want this behavior, I propose the patch above which doesn't change much but should be enough to accomplish this.

codecov-io commented 7 years ago

Codecov Report

Merging #12 into master will increase coverage by 0.02%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #12      +/-   ##
==========================================
+ Coverage   96.29%   96.31%   +0.02%     
==========================================
  Files           1        1              
  Lines         162      163       +1     
==========================================
+ Hits          156      157       +1     
  Misses          6        6
Impacted Files Coverage Δ
flatdict.py 96.31% <100%> (+0.02%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 523a293...5bf5637. Read the comment docs.

gmr commented 6 years ago

I took an alternative approach to this, breaking out the list coercion to a new class (FlatterDict for lack of a better name), instead of making one class that does everything.

Thanks for the PR!