| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Stub modules will be easier to track (and remove) if they are all kept
in lib-old/, instead of sprinkling them throughout the library.
|
|
|
|
|
|
| |
Renamed copy_reg to copyreg in the standard library, to avoid
spurious warnings and ease later merging to py3k branch. Public
documentation remains intact.
|
|
|
|
|
|
| |
callable() from copy_reg.py, so the interpreter now starts up
without warnings when '-3' is given. More work like this needs to
be done in the rest of the stdlib.
|
|
|
|
|
|
| |
Two (test_array and test_descr) were bug IMO; the third (copy_reg)
is a work-around which recognizes that object.__init__() doesn't do
anything.
|
|
|
|
| |
that have __private names in their __slots__.
|
|
|
|
|
| |
There's no point to passing it anymore, but there's a test that
expects the call to fail if you pass a non-callable object.
|
|
|
|
|
|
|
| |
The constructor() call only made sense when it registered the
constructor as safe for unpickling. We should probably remove the
module-global function, but need to worry about backwards
compatibility.
|
|
|
|
| |
Backported to 2.2.
|
| |
|
|
|
|
|
| |
was still referencing it will fail. Also removed some debug cruft
from _reduce_ex.
|
| |
|
|
|
|
|
| |
if it exists in preference over __reduce__. Now Tim can go implement this
in cPickle.c.
|
|
|
|
|
|
|
| |
This changes the default __new__ to refuse arguments iff tp_init is the
default __init__ implementation -- thus making it a TypeError when you
try to pass arguments to a constructor if the class doesn't override at
least __init__ or __new__.
|
|
|
|
|
|
| |
was used. This simplifies some logic in copy_reg.py (used by
pickling). It also broke a test, but this was rewritten to test the
new feature. :-)
|
| |
|
|
|
|
| |
pickle.py, where it makes save_newobj() unnecessary. Tests pass.
|
|
|
|
| |
generate these opcodes.
|
|
|
|
|
|
|
|
|
| |
this clarifies that they are part of an internal API (albeit shared
between pickle.py, copy_reg.py and cPickle.c).
I'd like to do the same for copy_reg.dispatch_table, but worry that it
might be used by existing code. This risk doesn't exist for the
extension registry.
|
|
|
|
|
| |
Imported the extension-registry dicts from copy_reg.py, in preparation for
tackling EXT[124].
|
|
|
|
| |
attr, and copy_reg.safe_constructors.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
doesn't have the _HEAPTYPE flag set, e.g. for time.struct_time and
posix.stat_result.
This fixes the immediate symptoms of SF bug #496873 (cPickle /
time.struct_time loop), replacing the infinite loop with an exception.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Fix for SF bug #482752: __getstate__ & __setstate__ ignored (by Anon.)
In fact, only __getstate__ isn't recognized. This fixes that.
- Separately, the test for base.__flags__ & _HEAPTYPE raised an
AttributeError exception when a classic class was amongst the
bases. Fixed this with a hasattr() bandaid (classic classes never
qualify as the "hard" base class anyway, which is what the code is
trying to find).
|
|
|
|
|
|
|
|
|
|
| |
fallback for objects that are neither supported by our dispatch table
nor have a __copy__ or __deepcopy__ method.
Changes to _reduce() in copy_reg.py to support reducing objects that
don't have a __dict__ -- copy.copy(complex()) now invokes _reduce().
Add tests for copy.copy() and copy.deepcopy() to test_regrtest.py.
|
|
|
|
|
| |
__class__. The __new__ protocol is up to this. (Thanks to Tim for
pointing this out.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Made cls.__module__ writable.
- Ensure that obj.__dict__ is returned as {}, not None, even upon first
reference; it simply springs into life when you ask for it.
(*) The pickling support is provisional for the following reasons:
- It doesn't support classes with __slots__.
- It relies on additional support in copy_reg.py: the C method
__reduce__, defined in the object class, really calls calling
copy_reg._reduce(obj). Eventually the Python code in copy_reg.py
needs to be migrated to C, but I'd like to experiment with the
Python implementation first. The _reduce() code also relies on an
additional helper function, _reconstructor(), defined in
copy_reg.py; this should also be reimplemented in C.
|
|
|
|
|
|
|
|
| |
added test script and expected output file as well
this closes patch 103297.
__all__ attributes will be added to other modules without first submitting
a patch, just adding the necessary line to the test script to verify
more-or-less correct implementation.
|
|
|
|
|
|
|
|
|
|
|
| |
support for extension types, not classes.
pickle(): If the type is a class or if the reduction function is not
callable, raise a TypeError.
constructor(): If the constructor is not callable, raise TypeError.
This (partially) closes SourceForge patch #101859.
|
|
|
|
|
|
|
|
|
|
|
| |
1. Comments at the beginning of the module, before
functions, and before classes have been turned
into docstrings.
2. Tabs are normalized to four spaces.
Also, removed the "remove" function from dircmp.py, which reimplements
list.remove() (it must have been very old).
|
| |
|
|
|