[issue21670] Add repr to shelve.Shelf

2014-06-24 Thread Berker Peksag
Changes by Berker Peksag : -- stage: patch review -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue21670] Add repr to shelve.Shelf

2014-06-24 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing

[issue21670] Add repr to shelve.Shelf

2014-06-24 Thread Claudiu Popa
Claudiu Popa added the comment: Alright, I agree with you now. You can close the issue if you want. -- ___ Python tracker ___ ___ Pyth

[issue21670] Add repr to shelve.Shelf

2014-06-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: When shelve stores its data on a disk, it is more similar to a file. After all, it can contain gigabytes of data, much larger than Python can address in RAM. I you want more readable repr, I with Raymond, -- use the repr of the underlying db and add readable

[issue21670] Add repr to shelve.Shelf

2014-06-24 Thread Claudiu Popa
Claudiu Popa added the comment: Fair point, Serhiy. But I see the shelve more similar to a persistent, dictionary-like object, than to a file. The fact that it uses some database behind is just an implementation detail. -- ___ Python tracker

[issue21670] Add repr to shelve.Shelf

2014-06-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't think this is right repr for shelve. As file's repr doesn't read and expose a content of a file, shelve's repr shouldn't read and expose all database content. -- nosy: +serhiy.storchaka ___ Python tracker

[issue21670] Add repr to shelve.Shelf

2014-06-22 Thread Claudiu Popa
Claudiu Popa added the comment: The problem is that the repr of the underlying db is not very helpful either, as seen for the dbm backend. >>> import dbm >>> dbm.open("test", "c") >>> f=_ >>> f[b"2"] = b"a" >>> f >>> But it shows the content of the underlying database, not the key / value pa

[issue21670] Add repr to shelve.Shelf

2014-06-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: This may not be the right repr for the usual way of creating shelves: d = shelve.open('tmp.shl') print(repr(d)) # I would expect the repr to show # the underlying db instead of all the

[issue21670] Add repr to shelve.Shelf

2014-06-22 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger stage: -> patch review ___ Python tracker ___ ___ Python

[issue21670] Add repr to shelve.Shelf

2014-06-05 Thread Claudiu.Popa
New submission from Claudiu.Popa: Hello! Working with Shelf instances in the interactive console is cumbersome because you can't have an instant feedback when running the following: >>> from shelve import Shelf >>> s = Shelf({}) >>> s['a'] = 1 >>> s This patch adds an useful repr to Shelf ob