[issue23401] Add pickle support of Mapping views

2016-06-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue23401] Add pickle support of Mapping views

2016-06-26 Thread Guido van Rossum
Guido van Rossum added the comment: Please close. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue23401] Add pickle support of Mapping views

2016-06-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Can this issue be closed? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23401] Add pickle support of Mapping views

2016-06-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: OK, then I withdraw my proposition. Thank you for your attention Raymond and Guido. -- ___ Python tracker ___ ___

[issue23401] Add pickle support of Mapping views

2016-06-07 Thread Guido van Rossum
Guido van Rossum added the comment: No, it should just be up to the implementation. Though you might add a note to the docs explaining that it's probably a misguided idea. On Tue, Jun 7, 2016 at 2:23 AM, Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > Should we forbid pickl

[issue23401] Add pickle support of Mapping views

2016-06-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Should we forbid pickling MappingView? And what about copying and deepcopying? -- ___ Python tracker ___

[issue23401] Add pickle support of Mapping views

2016-06-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Raymond, what is your opinion? Whether and how to pickle should be at the discretion of a concrete class rather than a requirement for being a mapping. For example, it may not make any sense for a persistent dictionary such as a FileDict or an SQLDict.

[issue23401] Add pickle support of Mapping views

2016-06-04 Thread Guido van Rossum
Guido van Rossum added the comment: I find it extremely suspicious that if you pickle the keys of a large object it also pickles that object. These are views, not copied data, for a reason. I also take back that this is okay for concrete dict. As for your reason (http://bugs.python.org/issue23

[issue23401] Add pickle support of Mapping views

2016-06-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In this case we need to implement pickle support separately in OrderedDict and any Mapping subclass. -- ___ Python tracker ___ __

[issue23401] Add pickle support of Mapping views

2016-06-04 Thread Guido van Rossum
Guido van Rossum added the comment: I think it's fine to do this for concrete classes, I just don't think it should be added to ABCs. --Guido (mobile) -- ___ Python tracker ___

[issue23401] Add pickle support of Mapping views

2016-06-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Because I can! I just want to ensure that all basic types (for which it makes sense) are correctly and portable pickleable, especially collections and related classes. Note that currently Mapping views are pickleable (as most pure Python classes), but pickle

[issue23401] Add pickle support of Mapping views

2016-06-04 Thread Guido van Rossum
Guido van Rossum added the comment: Serhiy, why would you want to separately pickle such a view? It's a trivial wrapper around a dict/mapping. What's the use case? -- ___ Python tracker __

[issue23401] Add pickle support of Mapping views

2016-06-04 Thread Guido van Rossum
Guido van Rossum added the comment: Raymond, what is your opinion? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue23401] Add pickle support of Mapping views

2016-06-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The option 3 is now available with pickle protocols >= 2 (but less efficient with protocols < 4). Adding pickle support of Mapping views doesn't add a requirement for all classes that purport to be mappings. But if you implement pickle support of your mapp

[issue23401] Add pickle support of Mapping views

2016-06-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: Guido, is it your intention that the ABCs grow pickle support? I presume if this were implemented that it would become a requirement for all classes (and their subclasses) that purport to be mappings. I thought that you had designed to the ABCs to stay f

[issue23401] Add pickle support of Mapping views

2015-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, and yet one option: 5) As a list or a tuple. `copyreg.__newobj__, (list,), None, iter(self._mapping.keys())` or `copyreg.__newobj__, (tuple, tuple(self._mapping))`. -- ___ Python tracker

[issue23401] Add pickle support of Mapping views

2015-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are many ways to pickle e.g. Mapping keys: 1) Default implementation (as an instances of Python class MappingKey). This is implementation depended and exposes private variable _mapping. Changing implementation of the keys() method will break compatibil

[issue23401] Add pickle support of Mapping views

2015-02-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +patch Added file: http://bugs.python.org/file38024/pickle_mapping_views.patch ___ Python tracker ___ _

[issue23401] Add pickle support of Mapping views

2015-02-06 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch adds pickle support of general Mapping views. See also issue23264. -- components: Library (Lib) messages: 235475 nosy: alexandre.vassalotti, pitrou, rhettinger, serhiy.storchaka, stutzbach priority: normal severity: normal stage: patc