summaryrefslogtreecommitdiffstats
path: root/Modules/_pickle.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #20326: Argument Clinic now uses a simple, unique signature toLarry Hastings2014-01-281-17/+17
| | | | | | | | | | annotate text signatures in docstrings, resulting in fewer false positives. "self" parameters are also explicitly marked, allowing inspect.Signature() to authoritatively detect (and skip) said parameters. Issue #20326: Argument Clinic now generates separate checksums for the input and output sections of the block, allowing external tools to verify that the input has not changed (and thus the output is not out-of-date).
* Issue #20395: Extract generated clinic code in Modules/_pickle.c to separate ↵Serhiy Storchaka2014-01-271-479/+28
| | | | file.
* silence compiler warning that 's' may be used uninitialized in the load ↵Christian Heimes2014-01-271-1/+1
| | | | function.
* Issue #20390: Small fixes and improvements for Argument Clinic.Larry Hastings2014-01-261-41/+8
|
* Issue #20189: Four additional builtin types (PyTypeObject,Larry Hastings2014-01-241-48/+48
| | | | | | PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type) have been modified to provide introspection information for builtins. Also: many additional Lib, test suite, and Argument Clinic fixes.
* Two minor Argument Clinic bugfixes: use the name of the class in theLarry Hastings2014-01-221-4/+4
| | | | | docstring for __new__ and __init__, and always use "goto exit" instead of returning "NULL" for failure to parse (as _new__ and __init__ return ints).
* Issue #20294: Argument Clinic now supports argument parsing for __new__ andLarry Hastings2014-01-191-48/+26
| | | | __init__ functions.
* Issue #20287: Argument Clinic's output is now configurable, allowingLarry Hastings2014-01-181-51/+19
| | | | delaying its output or even redirecting it to a separate file.
* Issue #20228: Argument Clinic now has special support for class specialLarry Hastings2014-01-121-8/+2
| | | | methods.
* Issue #19273: The marker comments Argument Clinic uses have been changedLarry Hastings2014-01-071-61/+61
| | | | to improve readability.
* Issue #19976: Argument Clinic METH_NOARGS functions now alwaysLarry Hastings2014-01-041-18/+122
| | | | take two parameters.
* Issue #19972: Add rarely used freefunc. This fixes a leak if sys.exit()Stefan Krah2013-12-141-8/+14
| | | | is used in a program.
* Issue #6784: Strings from Python 2 can now be unpickled as bytes objects.Alexandre Vassalotti2013-12-071-189/+217
| | | | | | | Initial patch by Merlijn van Deen. I've added a few unrelated docstring fixes in the patch while I was at it, which makes the documentation for pickle a bit more consistent.
* Issue #19881: Fix bad pickling of large bytes in cpickle.Alexandre Vassalotti2013-12-061-1/+1
|
* Issue #6477: Merge with 3.3.Alexandre Vassalotti2013-12-011-2/+2
|\
| * Issue #6477: Keep PyNotImplemented_Type and PyNone_Type private.Alexandre Vassalotti2013-12-011-2/+2
| |
* | Issue #6477: Merge with 3.3.Alexandre Vassalotti2013-12-011-1/+31
|\ \ | |/
| * Issue #6477: Added support for pickling the types of built-in singletons.Alexandre Vassalotti2013-12-011-1/+31
| |
* | Merge with 3.3.Alexandre Vassalotti2013-11-301-1/+1
|\ \ | |/
| * Fixed _pickle.Unpickler to handle empty persistent IDs correctly.Alexandre Vassalotti2013-11-301-1/+1
| |
* | Issue #17897: Optimized unpickle prefetching.Serhiy Storchaka2013-11-301-30/+22
| |
* | Use PyDict_GetItemWithError instead of PyDict_GetItem in cpickle.Alexandre Vassalotti2013-11-291-12/+35
| |
* | Remove explicit empty tuple reuse in cpickle.Alexandre Vassalotti2013-11-281-12/+6
| | | | | | | | | | | | PyTuple_New(0) always returns the same empty tuple from its free list anyway, so we are not saving much here. Plus, the code where this was used is on uncommon run paths.
* | Remove the tuple reuse optimization in _Pickle_FastCall.Alexandre Vassalotti2013-11-281-30/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I have noticed a race-condition occurring on one of the buildbots because of this optimization. The function called may release the GIL which means multiple threads may end up accessing the shared tuple. I could fix it up by storing the tuple to the Pickler and Unipickler object again, but honestly it really not worth the trouble. I ran many benchmarks and the only time the optimization helps is when using a fin-memory file, like io.BytesIO on which reads are super cheap, combined with pickle protocol less than 4. Even in this contrived case, the speedup is a about 5%. For everything else, this optimization does not provide any noticable improvements.
* | Encapsulate cpickle global state in a dedicated object.Alexandre Vassalotti2013-11-281-270/+426
| | | | | | | | | | This implements PEP 3121 module finalization as well. This change does not cause any significant impact on performance.
* | Combine the FastCall functions in cpickle.Alexandre Vassalotti2013-11-271-90/+42
| | | | | | | | | | I fixed the bug that was in my previous attempt of this cleanup. I ran the full test suite to verify I didn't introduce any obvious bugs.
* | Reverting e39db21df580 eagerly due to buildbot failures.Alexandre Vassalotti2013-11-251-33/+90
| |
* | Combine _Pickler_FastCall and _Unpickler_FastCall in cpickle.Alexandre Vassalotti2013-11-251-90/+33
| |
* | Issue #19739: Try to fix compiler warnings on 32-bit Windows.Alexandre Vassalotti2013-11-251-22/+21
| |
* | Merge save_int into save_long in cpickle to remove redundant code.Alexandre Vassalotti2013-11-251-53/+33
| | | | | | | | Also, replace unnessary uses of the #if preprocessor directive.
* | Simplify save_bool in cpickle.Alexandre Vassalotti2013-11-251-18/+11
| |
* | Use Clinic to process arguments in cpickle.Alexandre Vassalotti2013-11-241-257/+672
| | | | | | | | | | | | This doesn't make any functional changes to the exisiting implementation. The conversion did help however uncover documentation bugs. The best thing about this conversion is less C code to maintain by hand.
* | Remove code path in cpickle that does not exist in pickle.Alexandre Vassalotti2013-11-241-7/+1
| |
* | Make Ellipsis and NotImplemented picklable through the reduce protocol.Alexandre Vassalotti2013-11-241-32/+0
| |
* | Make built-in methods picklable through the reduce protocol.Alexandre Vassalotti2013-11-241-32/+0
| |
* | Make framing optional in pickle protocol 4.Alexandre Vassalotti2013-11-241-126/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow us to control in the future whether to use framing or not. For example, we may want to turn it off for tiny pickle where it doesn't help. The change also improves performance slightly: ### fastpickle ### Min: 0.608517 -> 0.557358: 1.09x faster Avg: 0.798892 -> 0.694738: 1.15x faster Significant (t=3.45) Stddev: 0.17145 -> 0.12704: 1.3496x smaller Timeline: http://goo.gl/3xQE1J ### pickle_dict ### Min: 0.669920 -> 0.615271: 1.09x faster Avg: 0.733633 -> 0.645058: 1.14x faster Significant (t=5.05) Stddev: 0.12041 -> 0.02961: 4.0662x smaller Timeline: http://goo.gl/LpLSXI ### pickle_list ### Min: 0.397583 -> 0.368112: 1.08x faster Avg: 0.412784 -> 0.397223: 1.04x faster Significant (t=2.78) Stddev: 0.01518 -> 0.03653: 2.4068x larger Timeline: http://goo.gl/v39E59 ### unpickle_list ### Min: 0.692935 -> 0.594870: 1.16x faster Avg: 0.730012 -> 0.628395: 1.16x faster Significant (t=17.76) Stddev: 0.02720 -> 0.02995: 1.1012x larger Timeline: http://goo.gl/2P9AEt The following not significant results are hidden, use -v to show them: fastunpickle.
* | Fix signed / unsigned comparisonAntoine Pitrou2013-11-231-1/+1
| |
* | gcc doesn't realize that dummy is always initialized by the function callGregory P. Smith2013-11-231-1/+1
| | | | | | | | | | and warns about potential uninitialized use. Silence that by initializing it to null.
* | Issue #17810: Add two missing error checks to save_globalChristian Heimes2013-11-231-2/+4
| | | | | | | | CID 1131946: Unchecked return value (CHECKED_RETURN)
* | MergeAntoine Pitrou2013-11-231-1/+1
|\ \
| * | Issue #17810: return -1 on errorChristian Heimes2013-11-231-1/+1
| | |
* | | Fix writing out 64-bit size fields on 32-bit buildsAntoine Pitrou2013-11-231-11/+21
|/ /
* | Issue #17810: Add NULL check to save_frozensetChristian Heimes2013-11-231-0/+3
| | | | | | | | CID 1131949: Dereference null return value (NULL_RETURNS)
* | Issue #17810: Implement PEP 3154, pickle protocol 4.Antoine Pitrou2013-11-231-367/+1013
| | | | | | | | Most of the work is by Alexandre.
* | Issue #19437: Use an identifier for "__name__" string in pickle to improveVictor Stinner2013-11-141-12/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | error handling The following code didn't handle correctly the failure of PyUnicode_InternFromString("__name__"). if (newobj_str == NULL) { newobj_str = PyUnicode_InternFromString("__newobj__"); name_str = PyUnicode_InternFromString("__name__"); if (newobj_str == NULL || name_str == NULL) return -1; }
* | Issue #19512: pickle now uses an identifier to only create the Unicode stringVictor Stinner2013-11-061-2/+4
| | | | | | | | "modules" once
* | Issue #19437: Fix _pickle, don't call _Unpickler_SkipConsumed() with anVictor Stinner2013-10-311-3/+3
| | | | | | | | exception set
* | cleanup _Unpickler_SkipConsumed(): remove 1 level of indentationVictor Stinner2013-10-311-12/+15
| |
* | Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-271-7/+7
|\ \ | |/ | | | | error messages and comments.
| * Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-271-7/+7
| | | | | | | | error messages and comments.