No project description provided
Project description
A pprint for CPython 3.6 dict objects that preserves insertion order.
About
CPython 3.6 uses a new “compact” representation for dict objects. As a nice side effect this happens to preserve the insertion order of keys.
The order-preserving aspect of this new implementation is considered an implementation detail and should not be relied upon
pprint.pprint() retains it’s behaviour from earlier Python releases. It formats a dict object by sorting the keys alphabetically.
>>> import pprint
>>> pprint.pprint({'foo': 1, 'bar': 2, 'baz': 3})
{'bar': 2, 'baz': 3, 'foo': 1}
oprint.pprint() throws out the old.
>>> import oprint
>>> oprint.pprint({'foo': 1, 'bar': 2, 'baz': 3})
{'foo': 1, 'bar': 2, 'baz': 3}
The library is otherwise a drop-in replacement for pprint.
Install
pip install oprint
Development
This project is developed on GitHub, please file issues for any feature or bug requests.
Contributors
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
Built Distribution
File details
Details for the file oprint-0.1.tar.gz
.
File metadata
- Download URL: oprint-0.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b16b5c45ad5888e84348d88926effff140b296a40c62e9c18ac2a089210d4db4 |
|
MD5 | 901ed798012c7ae61f723ec9983228fe |
|
BLAKE2b-256 | fac9aa72f852a1875b64d887010a79ca79d72197afad1b45dd9b41a68d63d8aa |
File details
Details for the file oprint-0.1-py3-none-any.whl
.
File metadata
- Download URL: oprint-0.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41c92990877987b7ab77f25397bfa1eaa0c2ad4995484bae9551905170b57eaf |
|
MD5 | 01cb26136700061f4bf7ba4e9d54db2f |
|
BLAKE2b-256 | bc2411366700a0c4fda6cf8af389cad8faa760b8105909805605b691b98a8d31 |