summaryrefslogtreecommitdiffstats
path: root/Lib/copy.py
Commit message (Collapse)AuthorAgeFilesLines
* Merging the py3k-pep3137 branch back into the py3k branch.Guido van Rossum2007-11-061-1/+1
| | | | | | | | | | | | | | No detailed change log; just check out the change log for the py3k-pep3137 branch. The most obvious changes: - str8 renamed to bytes (PyString at the C level); - bytes renamed to buffer (PyBytes at the C level); - PyString and PyUnicode are no longer compatible. I.e. we now have an immutable bytes type and a mutable bytes type. The behavior of PyString was modified quite a bit, to make it more bytes-like. Some changes are still on the to-do list.
* Merged revisions 55795-55816 via svnmerge fromGuido van Rossum2007-06-071-4/+6
| | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r55797 | neal.norwitz | 2007-06-07 00:00:57 -0700 (Thu, 07 Jun 2007) | 3 lines Get rid of some remnants of classic classes. types.ClassType == type. Also get rid of almost all uses of the types module and use the builtin name. ........ r55798 | neal.norwitz | 2007-06-07 00:12:36 -0700 (Thu, 07 Jun 2007) | 1 line Remove a use of types, verify commit hook works ........ r55809 | guido.van.rossum | 2007-06-07 11:11:29 -0700 (Thu, 07 Jun 2007) | 2 lines Fix syntax error introduced by Neal in last checkin. ........
* Register a dispatcher for str8. (This makes test_copy.py pass again.)Walter Dörwald2007-06-071-4/+1
| | | | Make registeration of str dispatcher unconditional.
* Merged revisions 55007-55179 via svnmerge fromGuido van Rossum2007-05-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r55077 | guido.van.rossum | 2007-05-02 11:54:37 -0700 (Wed, 02 May 2007) | 2 lines Use the new print syntax, at least. ........ r55142 | fred.drake | 2007-05-04 21:27:30 -0700 (Fri, 04 May 2007) | 1 line remove old cruftiness ........ r55143 | fred.drake | 2007-05-04 21:52:16 -0700 (Fri, 04 May 2007) | 1 line make this work with the new Python ........ r55162 | neal.norwitz | 2007-05-06 22:29:18 -0700 (Sun, 06 May 2007) | 1 line Get asdl code gen working with Python 2.3. Should continue to work with 3.0 ........ r55164 | neal.norwitz | 2007-05-07 00:00:38 -0700 (Mon, 07 May 2007) | 1 line Verify checkins to p3yk (sic) branch go to 3000 list. ........ r55166 | neal.norwitz | 2007-05-07 00:12:35 -0700 (Mon, 07 May 2007) | 1 line Fix this test so it runs again by importing warnings_test properly. ........ r55167 | neal.norwitz | 2007-05-07 01:03:22 -0700 (Mon, 07 May 2007) | 8 lines So long xrange. range() now supports values that are outside -sys.maxint to sys.maxint. floats raise a TypeError. This has been sitting for a long time. It probably has some problems and needs cleanup. Objects/rangeobject.c now uses 4-space indents since it is almost completely new. ........ r55171 | guido.van.rossum | 2007-05-07 10:21:26 -0700 (Mon, 07 May 2007) | 4 lines Fix two tests that were previously depending on significant spaces at the end of a line (and before that on Python 2.x print behavior that has no exact equivalent in 3.0). ........
* Rip out all the u"..." literals and calls to unicode().Guido van Rossum2007-05-021-1/+1
|
* Remove duplicate refs to int from int/long unification presumably. (There ↵Neal Norwitz2007-02-271-2/+1
| | | | might be more refs like these.)
* - PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;Guido van Rossum2007-02-111-3/+3
| | | | | | | | | | and .keys(), .items(), .values() return dict views. The dict views aren't fully functional yet; in particular, they can't be compared to sets yet. but they are useful as "iterator wells". There are still 27 failing unit tests; I expect that many of these have fairly trivial fixes, but there are so many, I could use help.
* Fix most trivially-findable print statements.Guido van Rossum2007-02-091-17/+17
| | | | | | | | | There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
* Rip out 'long' and 'L'-suffixed integer literals.Guido van Rossum2007-01-151-3/+3
| | | | (Rough first cut.)
* SF patch 1495675: Remove types.InstanceType and new.instanceGuido van Rossum2006-05-261-43/+0
| | | | (Collin Winter)
* Whitespace normalization.Tim Peters2006-02-261-1/+1
|
* - Patch 1433928:Guido van Rossum2006-02-251-1/+3
| | | | | | | | - The copy module now "copies" function objects (as atomic objects). - dict.__getitem__ now looks for a __missing__ hook before raising KeyError. - Added a new type, defaultdict, to the collections module. This uses the new __missing__ hook behavior added to dict (see above).
* SF bug #1219361 Fix typoRaymond Hettinger2005-06-131-1/+1
|
* Build with --disable-unicode again. Fixes #1158607.Martin v. Löwis2005-03-081-2/+2
| | | | Will backport to 2.4.
* Reduce the usage of the types module.Raymond Hettinger2005-02-071-14/+14
|
* Refactor the copy dispatcher code in copy.py. Simplifies and shortensRaymond Hettinger2004-03-081-35/+17
| | | | the code by grouping common cases together.
* Copy builtin functions as atomic. Fixes #746304. Will backport to 2.2.Martin v. Löwis2003-06-141-0/+2
|
* SF patch 707900, fixing bug 702858, by Steven Taschuk.Guido van Rossum2003-06-131-0/+1
| | | | | Copying a new-style class that had a reference to itself didn't work. (The same thing worked fine for old-style classes.)
* Get rid of many apply() calls.Guido van Rossum2003-02-271-2/+2
|
* Whitespace normalization.Tim Peters2003-02-191-1/+1
|
* Remove now unused _better_reduce.Guido van Rossum2003-02-191-1/+1
|
* Use __reduce_ex__ in copy.py. The test_*copy_cant() tests are simpler again.Guido van Rossum2003-02-191-22/+34
|
* Somehow, copy() of a classic class object was handledGuido van Rossum2003-02-071-0/+1
| | | | | | atomically, but deepcopy() didn't support this at all. I don't see any reason for this, so I'm adding ClassType to the set of types that are deep-copied atomically.
* Add support for copy_reg.dispatch_table.Guido van Rossum2003-02-071-48/+50
| | | | | Rewrote copy() and deepcopy() without avoidable try/except statements; getattr(x, name, None) or dict.get() are much faster than try/except.
* Move _better_reduce from copy.py to copy_reg.py, and also use it inGuido van Rossum2003-02-061-41/+1
| | | | pickle.py, where it makes save_newobj() unnecessary. Tests pass.
* Fix a bug in the way __getnewargs__ was handled.Guido van Rossum2003-02-061-1/+1
|
* Support all the new stuff supported by the new pickle code:Guido van Rossum2003-02-061-11/+64
| | | | | | - subclasses of list or dict - __reduce__ returning a 4-tuple or 5-tuple - slots
* Support __reduce__ returning a 4-tuple or 5-tuple.Guido van Rossum2003-02-061-1/+20
|
* Support copying booleans. Fixes #668925.Martin v. Löwis2003-01-161-0/+2
|
* Make sure that *any* object whose id() is used as a memo key is keptGuido van Rossum2002-08-121-2/+1
| | | | alive in the memo. This fixes SF bug 592567.
* SF patch 560794 (Greg Chapman): deepcopy can't handle customGuido van Rossum2002-06-101-8/+15
| | | | | | | | | | metaclasses. This is essentially the same problem as that reported in bug 494904 for pickle: deepcopy should treat instances of custom metaclasses the same way it treats instances of type 'type'. Bugfix candidate.
* Fix from SF patch 565085: copy._reduction doesn't __setstate__.Guido van Rossum2002-06-061-1/+4
| | | | | | Straightforward fix. Will backport to 2.2. If there's ever a new 2.1 release, this could be backported there too (since it's an issue with anything that's got both a __reduce__ and a __setstate__).
* Replaced .keys() with dictionary iteratorsRaymond Hettinger2002-06-021-4/+4
|
* SF 563203. Replaced 'has_key()' with 'in'.Raymond Hettinger2002-06-011-1/+1
|
* SF patch 518765 (Derek Harland): Bug in copy.py when used throughGuido van Rossum2002-02-281-1/+4
| | | | | | | | | | rexec. When using a restricted environment, imports of copy will fail with an AttributeError when trying to access types.CodeType. Bugfix candidate (all the way back to 1.5.3, but at least 2.1.3 and 2.2.1).
* Fix for SF bug ##497426: can't deepcopy recursive new objectsGuido van Rossum2001-12-281-4/+6
| | | | | | | | deepcopy(), _reconstruct(): pass the memo to the other function, so that recursive data structures built out of new-style objects may be deeply copied correctly. 2.2.1 bugfix!
* Add complex to the dispatch tables, to avoid going through the wholeGuido van Rossum2001-09-281-0/+8
| | | | rigmarole of __reduce__.
* Changes to copy() and deepcopy() in copy.py to support __reduce__ as aGuido van Rossum2001-09-281-7/+39
| | | | | | | | | | 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.
* Patch #445762: Support --disable-unicodeMartin v. Löwis2001-08-171-2/+8
| | | | | | | | - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests.
* added __all__ lists to a number of Python modulesSkip Montanaro2001-01-201-0/+2
| | | | | | | | 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.
* Whitespace normalization.Tim Peters2001-01-141-183/+183
|
* Patch by Finn Bock to support PyStringMap in Jython.Guido van Rossum2000-11-271-0/+9
|
* Added Unicode objects to the copy mechanism. Since these are immutable,Marc-André Lemburg2000-09-071-0/+2
| | | | they are copied as atomic types.
* Convert some old-style string exceptions to class exceptions.Fred Drake2000-08-171-2/+3
|
* Actually, the previous batch's comment should have been different;Guido van Rossum2000-02-041-3/+1
| | | | | | | | | | *this* set of patches is Ka-Ping's final sweep: The attached patches update the standard library so that all modules have docstrings beginning with one-line summaries. A new docstring was added to formatter. The docstring for os.py was updated to mention nt, os2, ce in addition to posix, dos, mac.
* Don't die if CodeType doesn't exist -- ignore the error. This couldGuido van Rossum1999-01-251-1/+4
| | | | happen in restricted mode.
* A few lines were indented using spaces instead of tabs -- fix them.Guido van Rossum1998-03-261-14/+14
|
* As Mike Fletcher pointed out, a __deepcopy__() method should be calledGuido van Rossum1998-03-131-1/+1
| | | | with the memo as an argument.
* Apply the same change to classes without an __getinitargs__() methodGuido van Rossum1997-12-071-5/+11
| | | | as in pickle: the new instance is created without calling __init__().
* Use __dict__.update(state) instead of for loop over state.items() andGuido van Rossum1997-10-261-11/+9
| | | | | | | call to setattr(). This changes semantics, following the change already implemented in pickle. Also reindented a few lines properly.