[issue31194] Inconsistent __repr__s for _collections objects

2017-08-15 Thread R. David Murray
R. David Murray added the comment: This is a duplicate of issue 27541. -- nosy: +r.david.murray resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Repr of collection's subclasses ___ Python tracker

[issue31194] Inconsistent __repr__s for _collections objects

2017-08-15 Thread Vedran Čačić
Vedran Čačić added the comment: More and more, Python looks to me like a certain language that I thought I had left behind a long time ago. [...] Each operator decides which sort of scalar it would be most appropriate to return. [...] In general, they do what

[issue31194] Inconsistent __repr__s for _collections objects

2017-08-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: IIRC, deque() did this to better match the behavior of list(). Not everything in Python is consistent and sometimes we have to pick and choose between what we want to be consistent with. For the most part, the decisions have worked out well in practice

[issue31194] Inconsistent __repr__s for _collections objects

2017-08-14 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger priority: normal -> low versions: +Python 3.7 -Python 3.6 ___ Python tracker

[issue31194] Inconsistent __repr__s for _collections objects

2017-08-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +rhettinger, serhiy.storchaka ___ Python tracker ___

[issue31194] Inconsistent __repr__s for _collections objects

2017-08-13 Thread Dan Snider
New submission from Dan Snider: With the new C implementation of collections.OrderedDict, its repr correctly uses the subclass's name, unlike deque and defaultdict. class Thing(_collections.OrderedDict): pass >>> Thing() Thing([]) class Thing(_collections.deque): pass >>> Thing()