[issue13842] Cannot pickle Ellipsis or NotImplemented

Antoine Pitrou report at bugs.python.org
Sun Feb 19 17:18:18 CET 2012


Antoine Pitrou <pitrou at 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 <report at bugs.python.org>
<http://bugs.python.org/issue13842>
_______________________________________


More information about the Python-bugs-list mailing list