[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-03-12 Thread Łukasz Langa

Łukasz Langa luk...@langa.pl added the comment:

There is indeed a 5% performance gain from using PyUnicode_FromString instead 
of the generic Py_BuildValue function.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13842
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-03-12 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 5832d3622473 by Łukasz Langa in branch 'default':
Fixes #13842: cannot pickle Ellipsis or NotImplemented.
http://hg.python.org/cpython/rev/5832d3622473

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13842
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-03-12 Thread Łukasz Langa

Changes by Łukasz Langa luk...@langa.pl:


--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13842
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-03-12 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 5353357382e2 by Łukasz Langa in branch 'default':
#13842: check whether PyUnicode_FromString succeeded
http://hg.python.org/cpython/rev/5353357382e2

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13842
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-03-08 Thread Łukasz Langa

Changes by Łukasz Langa luk...@langa.pl:


--
assignee:  - lukasz.langa
nosy: +lukasz.langa

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13842
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-02-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I haven't taken a look at the patch in detail, but it lacks some tests.
Pickling tests are generally in Lib/test/pickletester.py, they are invoked by 
test_pickle and test_pickletools.

--
stage: needs patch - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13842
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-02-19 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13842
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-02-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 I'm completely new to the C API so not sure if the way I am building
 python strings (to pass to save_global) is correct

It's correct but it's probably less efficient than calling a more specialized 
function, such as PyUnicode_FromString():
http://docs.python.org/dev/c-api/unicode.html#PyUnicode_FromString

You also have to check the return value (for non-NULL, NULL meaning an error 
occurred) before calling save_global with it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13842
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-01-24 Thread James Sanders

James Sanders bistromath...@gmail.com added the comment:

I've submitted a patch that just uses save_global to pickle Ellipsis and 
NotImplemented, so the resulting pickle should be unpicklable anywhere.  I'm 
completely new to the C API so not sure if the way I am building python strings 
(to pass to save_global) is correct, but it seems to work.

--
keywords: +patch
Added file: 
http://bugs.python.org/file24315/pickling_ellipsis_notimplemented.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13842
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-01-23 Thread James Sanders

New submission from James Sanders bistromath...@gmail.com:

At present, the built-in constants Ellipsis (...) and NotImplemented cannot be 
pickled.  Perhaps there is a good reason for this, but the only discussion I 
can find is at msg108957, where it is stated that these values (along with 
their types, and type(None)) cannot be pickled.

I ran across this in a class that keeps track of numpy-style slicing 
operations, and so sometimes stores references to Ellipsis.  While this is easy 
to work around, it does seem a little surprising that ... cannot be pickled, 
when slice objects can be.  I don't know if there is a likely use for pickling 
NotImplemented.

If this is not changed, perhaps it could be explicitly stated in the 
documentation that these objects cannot be pickled?

--
messages: 151838
nosy: James.Sanders, alexandre.vassalotti, pitrou
priority: normal
severity: normal
status: open
title: Cannot pickle Ellipsis or NotImplemented
type: enhancement
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13842
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-01-23 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I think it's a reasonable feature request. Now someone has to write a patch for 
it.

--
stage:  - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13842
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-01-23 Thread Alexandre Vassalotti

Alexandre Vassalotti alexan...@peadrop.com added the comment:

We will need to bump the protocol number to add support for None, Ellipsis, and 
NotImplemented. Antoine, can you add this to PEP 3154?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13842
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13842] Cannot pickle Ellipsis or NotImplemented

2012-01-23 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 We will need to bump the protocol number to add support for None,
 Ellipsis, and NotImplemented. Antoine, can you add this to PEP 3154?

I don't think this needs a protocol bump. These are global singletons,
they can be pickled as such, and they will be unpickleable on any
Python.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13842
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com