Raymond Hettinger wrote: > <enumerate object: 'A', 'B', 'C', 'D', 'E', 'F'> I quite like the idea of something along those lines. For example: try: itr = iter(obj) except TypeError: pass else: return "<iterable %s: %s>" % (obj.__class__.__name__, <as for list contents>)) Doing this only in pprint also reduces the chances of accidentally consuming an iterator (which was a reasonable objection when I suggested changing the __str__ implementation on some of the standard iterators some time ago). Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia ---------------------------------------------------------------
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4