[issue9269] Cannot pickle self-referencing sets

2013-11-29 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : -- assignee: -> alexandre.vassalotti resolution: -> duplicate stage: patch review -> committed/rejected status: open -> closed superseder: -> Implement PEP 3154 (pickle protocol 4) ___ Python tracker

[issue9269] Cannot pickle self-referencing sets

2012-07-27 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- assignee: belopolsky -> dependencies: -Pickle breakage with reduction of recursive structures stage: needs patch -> patch review versions: +Python 3.4 -Python 3.2 ___ Python tracker

[issue9269] Cannot pickle self-referencing sets

2012-07-27 Thread Stefan Mihaila
Stefan Mihaila added the comment: Attaching patch for fixing a test and adding better testing of sets. -- Added file: http://bugs.python.org/file26539/sets-test.patch ___ Python tracker

[issue9269] Cannot pickle self-referencing sets

2012-07-26 Thread Stefan Mihaila
Stefan Mihaila added the comment: I have attached a fix to this issue (and implicitly issue1062277). This patch allows pickling self-referential sets by implementing a set.__reduce__ which uses states as opposed to ctor parameters. Before: >>> s=set([1,2,3]) >>> s.__reduce__() (, ([1, 2, 3],)

[issue9269] Cannot pickle self-referencing sets

2011-12-10 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue9269] Cannot pickle self-referencing sets

2011-04-23 Thread Alex Gaynor
Changes by Alex Gaynor : -- nosy: +alex ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/m

[issue9269] Cannot pickle self-referencing sets

2011-03-08 Thread bcroq
Changes by bcroq : -- nosy: +bcroq ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailma

[issue9269] Cannot pickle self-referencing sets

2010-09-01 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- priority: normal -> low ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue9269] Cannot pickle self-referencing sets

2010-08-09 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- components: +Library (Lib) -Interpreter Core versions: -Python 2.7 ___ Python tracker ___ ___ Python-bu

[issue9269] Cannot pickle self-referencing sets

2010-07-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Upon further investigation, I am no longer convinced that "reduce cycles" are necessarily fatal to pickling. I am attaching a script testcycle.py that allows creating cycles using various containers. It takes the name of container class as an argument

[issue9269] Cannot pickle self-referencing sets

2010-07-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The test case in cycle.py tricks set into accepting mutable objects by > > creating a class with default __hash__. This falls into a category of > > "don't do it". I beg to differ. There is a reason we allow people to define __hash__ and that's to define

[issue9269] Cannot pickle self-referencing sets

2010-07-15 Thread mike bayer
mike bayer added the comment: OK, more specifically, here's the kind of situation where items in a set are mutable: company = Session.query(Company).first() # company.employees is a set() company.employees # each employee references the parent company for e in company.employees: assert e

[issue9269] Cannot pickle self-referencing sets

2010-07-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Jul 15, 2010 at 8:52 PM, Jack Diederich wrote: .. >  If database rows were mutable the results of a JOIN could be nonsensical. And if your result set is self-referential you have a bigger problem on your hands than not being able to pickle it. :

[issue9269] Cannot pickle self-referencing sets

2010-07-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Jul 15, 2010 at 8:26 PM, mike bayer wrote: .. > where is it defined that sets are not "supposed" to contain mutable items?   > such a requirement vastly limits the usefulness of sets. > Well, there is no such requirement. The actual requirement

[issue9269] Cannot pickle self-referencing sets

2010-07-15 Thread Jack Diederich
Jack Diederich added the comment: Mike, it is better to think of database rows as immutable tuples. During the course of a query the contents of the database are considered static - hence all that locking and kvetching about this or that database not having "true" foreign key support. If da

[issue9269] Cannot pickle self-referencing sets

2010-07-15 Thread mike bayer
mike bayer added the comment: where is it defined that sets are not "supposed" to contain mutable items? such a requirement vastly limits the usefulness of sets. Consider that relational database rows are mutable. A result set containing multiple rows which each have a primary key comprise

[issue9269] Cannot pickle self-referencing sets

2010-07-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am reclassifying this as an RFE because as a bug, this is a duplicate of issue1062277. The later contains an excellent description of the problem by Dima Dorfman: Our pickle implementations don't check for reduce cycles. This is somewhat co

[issue9269] Cannot pickle self-referencing sets

2010-07-15 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +merwok ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue9269] Cannot pickle self-referencing sets

2010-07-15 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file18020/cycle.py ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue9269] Cannot pickle self-referencing sets

2010-07-15 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file18021/cycle.py ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue9269] Cannot pickle self-referencing sets

2010-07-15 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +alexandre.vassalotti, grubert, rhettinger, schmir, zzzeek ___ Python tracker ___ ___ Python

[issue9269] Cannot pickle self-referencing sets

2010-07-15 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : Attached script, cycle.py demonstrates a simplification of the behavior reported by mike bayer in msg77200. Essentially, the script attempts to pickle a set that contains a class instance that has an attribute referring back to the set: class C: