PHP compact for Python
Project description
Compact
PHP compact() ported to Python
(Please use this for development only!)
from compact import compact
a = 1
b = 2
c = compact(a, 'b')
# -> {'a': 1, 'b': 2}
compact(c,
d,
dirty=True)
# -> {c: {'a': 1, 'b': 2}, d: None}
Only works in scripts, not interactive use (the program needs to be able to read the source files)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
compact-0.1.2.tar.gz
(2.2 kB
view hashes)