Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Use list/tuple/dict/set subclass's overridden __repr__ instead of the pretty #452

Merged
merged 1 commit into from May 17, 2011

Conversation

Projects
None yet
2 participants
Contributor

rkern commented May 17, 2011

BUG: For subclasses of tuple, list, dict, set, and frozenset, only use the pretty-printer if the subclasses do not replace the base class's __repr__.

I have recently used a couple of libraries that subclass list and tuple to represent their data structures. The subclasses provided their own __repr__ methods that were essential to comprehending their contents. pretty ignored these and used the pretty-printers designed for their base types, omitting critical information. I have modified these pretty-printers to check that if the subclass's __repr__ differs from the base class __repr__ before continuing with the pretty-printing logic.

@rkern rkern BUG: For subclasses of tuple, list, dict, set, and frozenset, only us…
…e the pretty-printer if the subclasses do not replace the base class's __repr__.
aab7676

@ellisonbg ellisonbg added a commit that referenced this pull request May 17, 2011

@ellisonbg ellisonbg Merge pull request #452 from rkern/pretty-subtype-repr
Use list/tuple/dict/set subclass's overridden __repr__ instead of the pretty
0bdf51b

@ellisonbg ellisonbg merged commit 0bdf51b into ipython:master May 17, 2011

@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014

@ellisonbg ellisonbg Merge pull request #452 from rkern/pretty-subtype-repr
Use list/tuple/dict/set subclass's overridden __repr__ instead of the pretty
6afeaa4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment