Alexandre Vassalotti added the comment:
I thought it over. I don't think the fix is appropriate for 2.x, as it seems
closer to being an extra feature than a bug fix.
Thanks Antoine for calling me out on this one.
--
resolution: - wont fix
stage: patch review - committed/rejected
Roundup Robot added the comment:
New changeset 16eba94d3cfe by Alexandre Vassalotti in branch '3.3':
Issue #6477: Added support for pickling the types of built-in singletons.
http://hg.python.org/cpython/rev/16eba94d3cfe
New changeset ff56f48b3277 by Alexandre Vassalotti in branch 'default':
Changes by Alexandre Vassalotti alexan...@peadrop.com:
--
assignee: docs@python - alexandre.vassalotti
resolution: - fixed
stage: needs patch - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset fbb97f6eb3b3 by Alexandre Vassalotti in branch '2.7':
Issue #6477: Added pickling support for singletons and their types.
http://hg.python.org/cpython/rev/fbb97f6eb3b3
--
___
Python tracker
Antoine Pitrou added the comment:
Uh... Your commits make PyNone_Type and PyNotImplemented_Type public APIs,
which I don't think is ok, especially not in bugfix releases.
Also, it would be nice to post patches on the tracker before committing (not
for trivial patches of course, but it's
Alexandre Vassalotti added the comment:
Would you be okay with removing the static declaration of PyNotImplemented_Type
and PyNone_Type if we prefix their name with an underscore? There isn't any
other way to fix this without making the types linkable.
I might revert the 2.7 change anyway as
Roundup Robot added the comment:
New changeset d964d7023aa4 by Alexandre Vassalotti in branch '2.7':
Issue #6477: Revert fbb97f6eb3b3 as it broke test_xpickle.
http://hg.python.org/cpython/rev/d964d7023aa4
--
___
Python tracker rep...@bugs.python.org
Antoine Pitrou added the comment:
Yeah, adding an underscore is a fine way of dealing with this if the symbol has
to be exported.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6477
___
Roundup Robot added the comment:
New changeset 9fcba15d7685 by Alexandre Vassalotti in branch '3.3':
Issue #6477: Keep PyNotImplemented_Type and PyNone_Type private.
http://hg.python.org/cpython/rev/9fcba15d7685
New changeset 7d6c27fa7f32 by Alexandre Vassalotti in branch 'default':
Issue
Alexandre Vassalotti added the comment:
Antoine, are you okay with applying this fix to 2.7? Or should we just mark
this as a won't fix?
--
keywords: +patch
priority: low - normal
resolution: fixed -
stage: committed/rejected - patch review
versions: -Python 3.2, Python 3.3, Python
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
keywords: +easy
stage: - needs patch
versions: +Python 3.3, Python 3.4 -Python 2.6, Python 3.0, Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6477
Jason R. Coombs jar...@jaraco.com added the comment:
I've encountered a use-case where the need to pickle NoneType is more relevant
(and difficult to work around).
We have a strongly-type Limited Python language, LimPy, which is based on
Python (https://bitbucket.org/yougov/limpy). This
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
Ellipsis and NotImplemented are different from None because they are not
pickleable themselves. The None situation is more similar to that of say
module level functions:
def f(): pass
...
dumps(f) # works
Nick Coghlan ncogh...@gmail.com added the comment:
Given that dumps(type(Ellipsis)) and dumps(type(NotImplemented)) don't
work either, I am reclassifying this as a documentation bug.
The thing about the types of these three objects (None, Ellipsis,
NotImplemented) is that they are all designed
Alexandre Vassalotti alexan...@peadrop.com added the comment:
I agree with Nick.
And if you really want to, you could hack a Pickler subclass to support
NoneType:
import io
import pickle
class XPickler(pickle.Pickler):
def persistent_id(self, obj):
if obj is type(None):
return
Hagen Fürstenau hfuerste...@gmx.net added the comment:
but I think it is a bug
I think it is either a feature request (make NoneType picklable) or a
documentation issue (document that it's not).
--
nosy: +hagen
___
Python tracker
Alexandre Vassalotti alexan...@peadrop.com added the comment:
I don't see why you want to pickle NoneType. Do you have a proper
use-case for this, or are you just playing around with pickle?
--
nosy: +alexandre.vassalotti
priority: - low
___
Python
July Tikhonov july.t...@gmail.com added the comment:
No, my program failed on this. It was not a big problem to manage this,
but I think it is a bug. And it isn't documented (or I can't find it).
Other built-in types have no such problem. Is there something special
with NoneType?
--
New submission from July Tikhonov july.t...@gmail.com:
Python 3.2a0 (py3k:73749M, Jul 1 2009, 23:17:59)
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
Type help, copyright, credits or license for more information.
import pickle
[40072 refs]
pickle.dumps(type(None))
Traceback (most
19 matches
Mail list logo