[ python-Bugs-1098985 ] set objects cannot be marshalled

2005-01-11 Thread SourceForge.net
Bugs item #1098985, was opened at 2005-01-09 11:28
Message generated for change (Comment added) made by greg_ball
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1098985group_id=5470

Category: Python Library
Group: Python 2.5
Status: Closed
Resolution: Fixed
Priority: 4
Submitted By: Gregory H. Ball (greg_ball)
Assigned to: Raymond Hettinger (rhettinger)
Summary: set objects cannot be marshalled

Initial Comment:
It would be nice if set objects could be marshalled.
This would require extra code in marshal.c very similar
to that for dictionaries. Since sets can be pickled I
guess this is not critical.


--

Comment By: Gregory H. Ball (greg_ball)
Date: 2005-01-11 13:12

Message:
Logged In: YES 
user_id=11365

Thanks for the quick work Raymond!  I see you have added
a test case too.  I am attaching a patch which implements
this change in a different style, based on setobject.h
publicly advertising that v-data is a dictionary for any
set object v.
It passes the new test code (and the rest of the test suite).


--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-01-10 22:03

Message:
Logged In: YES 
user_id=80475

Then let things be nice for all.
See Python marshal.c 1.81.

--

Comment By: Tim Peters (tim_one)
Date: 2005-01-10 20:51

Message:
Logged In: YES 
user_id=31435

Just noting that some people prefer to use marshal instead of 
pickle because unmarshaling can't end up executing arbitrary 
user-defined code (but unpickling can, via arbitrary module 
importing and arbitrary construction of objects of user-
defined classes).  That's really not one of marshal's goals, 
though, so would be nice is as strong as it gets.

--

Comment By: Guido van Rossum (gvanrossum)
Date: 2005-01-10 19:25

Message:
Logged In: YES 
user_id=6380

As the OP says, it would be nice. Let's see if he or someone
else wants it bad enough to submit a patch.

--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-01-10 19:17

Message:
Logged In: YES 
user_id=80475

Guido, what to you think about the OP's request?  The need
does not arise for pyc files and pickling takes care of
general persistance needs.   Is there something to be gained?

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1098985group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1098985 ] set objects cannot be marshalled

2005-01-11 Thread SourceForge.net
Bugs item #1098985, was opened at 2005-01-09 11:28
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1098985group_id=5470

Category: Python Library
Group: Python 2.5
Status: Closed
Resolution: Fixed
Priority: 4
Submitted By: Gregory H. Ball (greg_ball)
Assigned to: Raymond Hettinger (rhettinger)
Summary: set objects cannot be marshalled

Initial Comment:
It would be nice if set objects could be marshalled.
This would require extra code in marshal.c very similar
to that for dictionaries. Since sets can be pickled I
guess this is not critical.


--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-01-11 15:39

Message:
Logged In: YES 
user_id=80475

I prefer the existing code though it is slightly inefficient
(creating an intermediate tuple whose size is known in
advance and whose elements are known to be unique). 

IMO, this beats breaking the encapsulation of the set object
structure (knowledge of the v-data field and knowledge that
the dict values are set to True).  I want to preserve the
option for sets to be possibly re-implemented without an
underlying dictionary.

Someday, I'll craft a C API for sets.  It will include an
ability to build-up the values element by element.

P.S.  The code in the attachment needs error checking for
the call to  PyDict_SetItem().

--

Comment By: Gregory H. Ball (greg_ball)
Date: 2005-01-11 13:12

Message:
Logged In: YES 
user_id=11365

Thanks for the quick work Raymond!  I see you have added
a test case too.  I am attaching a patch which implements
this change in a different style, based on setobject.h
publicly advertising that v-data is a dictionary for any
set object v.
It passes the new test code (and the rest of the test suite).


--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-01-10 22:03

Message:
Logged In: YES 
user_id=80475

Then let things be nice for all.
See Python marshal.c 1.81.

--

Comment By: Tim Peters (tim_one)
Date: 2005-01-10 20:51

Message:
Logged In: YES 
user_id=31435

Just noting that some people prefer to use marshal instead of 
pickle because unmarshaling can't end up executing arbitrary 
user-defined code (but unpickling can, via arbitrary module 
importing and arbitrary construction of objects of user-
defined classes).  That's really not one of marshal's goals, 
though, so would be nice is as strong as it gets.

--

Comment By: Guido van Rossum (gvanrossum)
Date: 2005-01-10 19:25

Message:
Logged In: YES 
user_id=6380

As the OP says, it would be nice. Let's see if he or someone
else wants it bad enough to submit a patch.

--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-01-10 19:17

Message:
Logged In: YES 
user_id=80475

Guido, what to you think about the OP's request?  The need
does not arise for pyc files and pickling takes care of
general persistance needs.   Is there something to be gained?

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1098985group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1098985 ] set objects cannot be marshalled

2005-01-10 Thread SourceForge.net
Bugs item #1098985, was opened at 2005-01-09 11:28
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1098985group_id=5470

Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Gregory H. Ball (greg_ball)
Assigned to: Guido van Rossum (gvanrossum)
Summary: set objects cannot be marshalled

Initial Comment:
It would be nice if set objects could be marshalled.
This would require extra code in marshal.c very similar
to that for dictionaries. Since sets can be pickled I
guess this is not critical.


--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-01-10 19:17

Message:
Logged In: YES 
user_id=80475

Guido, what to you think about the OP's request?  The need
does not arise for pyc files and pickling takes care of
general persistance needs.   Is there something to be gained?

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1098985group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1098985 ] set objects cannot be marshalled

2005-01-10 Thread SourceForge.net
Bugs item #1098985, was opened at 2005-01-09 11:28
Message generated for change (Comment added) made by gvanrossum
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1098985group_id=5470

Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 4
Submitted By: Gregory H. Ball (greg_ball)
Assigned to: Raymond Hettinger (rhettinger)
Summary: set objects cannot be marshalled

Initial Comment:
It would be nice if set objects could be marshalled.
This would require extra code in marshal.c very similar
to that for dictionaries. Since sets can be pickled I
guess this is not critical.


--

Comment By: Guido van Rossum (gvanrossum)
Date: 2005-01-10 19:25

Message:
Logged In: YES 
user_id=6380

As the OP says, it would be nice. Let's see if he or someone
else wants it bad enough to submit a patch.

--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-01-10 19:17

Message:
Logged In: YES 
user_id=80475

Guido, what to you think about the OP's request?  The need
does not arise for pyc files and pickling takes care of
general persistance needs.   Is there something to be gained?

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1098985group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1098985 ] set objects cannot be marshalled

2005-01-10 Thread SourceForge.net
Bugs item #1098985, was opened at 2005-01-09 11:28
Message generated for change (Comment added) made by tim_one
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1098985group_id=5470

Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 4
Submitted By: Gregory H. Ball (greg_ball)
Assigned to: Raymond Hettinger (rhettinger)
Summary: set objects cannot be marshalled

Initial Comment:
It would be nice if set objects could be marshalled.
This would require extra code in marshal.c very similar
to that for dictionaries. Since sets can be pickled I
guess this is not critical.


--

Comment By: Tim Peters (tim_one)
Date: 2005-01-10 20:51

Message:
Logged In: YES 
user_id=31435

Just noting that some people prefer to use marshal instead of 
pickle because unmarshaling can't end up executing arbitrary 
user-defined code (but unpickling can, via arbitrary module 
importing and arbitrary construction of objects of user-
defined classes).  That's really not one of marshal's goals, 
though, so would be nice is as strong as it gets.

--

Comment By: Guido van Rossum (gvanrossum)
Date: 2005-01-10 19:25

Message:
Logged In: YES 
user_id=6380

As the OP says, it would be nice. Let's see if he or someone
else wants it bad enough to submit a patch.

--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-01-10 19:17

Message:
Logged In: YES 
user_id=80475

Guido, what to you think about the OP's request?  The need
does not arise for pyc files and pickling takes care of
general persistance needs.   Is there something to be gained?

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1098985group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1098985 ] set objects cannot be marshalled

2005-01-10 Thread SourceForge.net
Bugs item #1098985, was opened at 2005-01-09 11:28
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1098985group_id=5470

Category: Python Library
Group: Python 2.5
Status: Closed
Resolution: Fixed
Priority: 4
Submitted By: Gregory H. Ball (greg_ball)
Assigned to: Raymond Hettinger (rhettinger)
Summary: set objects cannot be marshalled

Initial Comment:
It would be nice if set objects could be marshalled.
This would require extra code in marshal.c very similar
to that for dictionaries. Since sets can be pickled I
guess this is not critical.


--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-01-10 22:03

Message:
Logged In: YES 
user_id=80475

Then let things be nice for all.
See Python marshal.c 1.81.

--

Comment By: Tim Peters (tim_one)
Date: 2005-01-10 20:51

Message:
Logged In: YES 
user_id=31435

Just noting that some people prefer to use marshal instead of 
pickle because unmarshaling can't end up executing arbitrary 
user-defined code (but unpickling can, via arbitrary module 
importing and arbitrary construction of objects of user-
defined classes).  That's really not one of marshal's goals, 
though, so would be nice is as strong as it gets.

--

Comment By: Guido van Rossum (gvanrossum)
Date: 2005-01-10 19:25

Message:
Logged In: YES 
user_id=6380

As the OP says, it would be nice. Let's see if he or someone
else wants it bad enough to submit a patch.

--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-01-10 19:17

Message:
Logged In: YES 
user_id=80475

Guido, what to you think about the OP's request?  The need
does not arise for pyc files and pickling takes care of
general persistance needs.   Is there something to be gained?

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=105470aid=1098985group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com