Skip to main content

No project description provided

Project description

Build Tests

A pprint for CPython 3.6 dict objects that preserves insertion order.


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.


pip install oprint


This project is developed on GitHub, please file issues for any feature or bug requests.


Project details

Release history Release notifications | RSS feed

This version


Download files

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

Files for oprint, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size oprint-0.1-py3-none-any.whl (4.8 kB) File type Wheel Python version 3.6 Upload date Hashes View
Filename, size oprint-0.1.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page