Skip to main content

Easy flattening with detailed setting

Project description

Easy flattening with detailed setting

Powered by Yamato Nagata

GitHub

>>> list(flatten(["12", (3, [4]), [5, 6, {7, "8"}]]))
['12', 3, 4, 5, 6, 7, '8']
>>> list(flatten(["12", (3, [4]), [5, 6, {7, "8"}]], ignore=(), peep=()))
['1', '2', 3, 4, 5, 6, 7, '8']
>>> list(flatten(["12", (3, [4]), [5, 6, {7, "8"}]], ignore=(), peep=(tuple,)))
['1', '2', (3, 4), 5, 6, 7, '8']
>>> list(flatten(["12", (3, [4]), [5, 6, {7, "8"}]], ignore=(), peep=(tuple,), depth=1))
['1', '2', (3, [4]), 5, 6, {7, '8'}]
>>> list(flatten(["12", (3, [4]), [5, 6, {7, "8"}]], ignore=(), peep=(tuple,), depth=0))
['12', (3, [4]), [5, 6, {7, '8'}]]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flatto-0.0.1.tar.gz (2.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page