Commit graph

7561 commits

Author SHA1 Message Date
Guido van Rossum
d6c9e63af9 First baby steps towards implementing protocol 2: PROTO, LONG1 and LONG4. 2003-01-28 03:49:52 +00:00
Tim Peters
d95c2df3a9 Fixed odd whitespace after "if", which I believe I introduced long ago. 2003-01-28 03:41:54 +00:00
Tim Peters
8fda7bc48d save_int(): Fixed two new off-by-1 glitches. 2003-01-28 03:40:52 +00:00
Guido van Rossum
e0b904232f Add a comment explaining that struct.pack() beats marshal.dumps(), but
marshal.loads() beats struct.unpack()!  Possibly because the latter
creates a one-tuple. :-(
2003-01-28 03:17:21 +00:00
Guido van Rossum
5c938d00a1 Got rid of mdumps; I timed it, and struct.pack("<i", x) is more than
40% faster than marshal.dumps(x)[1:]!  (That's not counting the
module attribute lookups, which can be avoided in either case.)
2003-01-28 03:03:08 +00:00
Tim Peters
f558da0f90 save_tuple(): Minor rewriting, and added a comment about the subtlety
created by recursive tuples.
2003-01-28 02:09:55 +00:00
Tim Peters
209ad95b00 load_appends(): replaced .append() loop with an .extend(). 2003-01-28 01:44:45 +00:00
Tim Peters
c23d18a955 Comments. 2003-01-28 01:41:51 +00:00
Tim Peters
064567e41a save_dict(): Untangled most of the bin-vs-not-bin logic. Also used
iteritems() instead of materializing a (possibly giant) list of the
items.
2003-01-28 01:34:43 +00:00
Tim Peters
21c18f0bf5 save_list(): Rewrote, to untangle the proto 0 from the proto 1 cases.
The code is much easier to follow now, and I bet it's faster too.
2003-01-28 01:15:46 +00:00
Tim Peters
22dc6f4f7a save_list(): removed unused local "d". 2003-01-28 01:07:48 +00:00
Tim Peters
58d7846e68 save_list(): removed unused local "memo". 2003-01-28 01:07:10 +00:00
Tim Peters
bd1cdb9227 save_pers(): Switched the order of cases, to get rid of a "not", and to
make the bin-vs-not-bin order consistent with what other routines try to
do (they almost all handle the bin case first).
2003-01-28 01:03:10 +00:00
Tim Peters
518df0dae4 Several routines appeared to inline the guts of memoize(), possibly for
some notion of low-level efficiency.  Undid that, but left one routine
alone:  save_inst() claims it has a reason for not using memoize().
I don't understand that comment, so added an XXX comment there.
2003-01-28 01:00:38 +00:00
Tim Peters
b32a8317d7 save(): Fiddled the control flow to put the normal case where it
belongs.  This is a much smaller change than it may appear:  the bulk
of the function merely got unindented by one level.
2003-01-28 00:48:09 +00:00
Tim Peters
c9d7c4a656 Added XXX about save()'s special-casing of tuples -- I don't get it. 2003-01-28 00:43:26 +00:00
Tim Peters
22987e3cbd save_bool(): simplified. 2003-01-28 00:26:14 +00:00
Tim Peters
cbd0a32d09 Repaired grammar in new comment. 2003-01-28 00:24:43 +00:00
Tim Peters
b377f8ac3e clear_memo(): Repaired grammar in docstring. 2003-01-28 00:23:36 +00:00
Tim Peters
e105478a0c Added one-line comments to the proto 2 opcodes. 2003-01-28 00:22:12 +00:00
Neal Norwitz
784a3f53a8 Use proper function name in exception messages 2003-01-28 00:20:41 +00:00
Tim Peters
fdb8cfab08 Removed the new LONG2 opcode: it's extravagant. If LONG1 isn't enough,
then the embedded argument consumes at least 256 bytes.  The difference
between a 3-byte prefix (LONG2 + 2 bytes) and a 5-byte prefix (LONG4 +
4 bytes) is at worst less than 1%.  Note that binary strings and binary
Unicode strings also have only "size is 1 byte, or size is 4 bytes?"
flavors, and I expect for the same reason.  The only place a 2-byte
thingie was used was in BININT2, where the 2 bytes make up the *entire*
embedded argument (and now EXT2 also does this); that's a large savings
over 4 bytes, because the total opcode+argument size is so small in
the BININT2/EXT2 case.

Removed the TAKEN_FROM_ARGUMENT "number of bytes" code, and bifurcated it
into TAKEN_FROM_ARGUMENT1 and TAKEN_FROM_ARGUMENT4.  Now there's enough
info in ArgumentDescriptor objects to deduce the # of bytes consumed by
each opcode.

Rearranged the order in which proto2 opcodes are listed in pickle.py.
2003-01-28 00:13:19 +00:00
Tim Peters
bdbe74183c Documented the 2's-comp business for the new long opcodes. 2003-01-27 23:54:04 +00:00
Tim Peters
5eed340267 Whitespace normalization. 2003-01-27 23:51:36 +00:00
Tim Peters
217e571a19 decode_long(): Simplified the "is it negative?" test. 2003-01-27 23:51:11 +00:00
Guido van Rossum
f29d3d6011 Begin the change from 'binary vs. text mode' to 'protocol 0, 1, 2'.
The protocol now defaults to 1.  Protocol 2 is still unimplemented.
2003-01-27 22:47:53 +00:00
Guido van Rossum
5a2d8f5e9a Begin documenting protocol 2. 2003-01-27 21:44:25 +00:00
Tim Peters
bb38e306ae Added some comments. 2003-01-27 21:25:41 +00:00
Tim Peters
e46b73f5b3 memoize(): Reworded the docs to try to disentangle the Pickler's memo
dict from the Unpickler's memo (which is a different beast!).
2003-01-27 21:22:10 +00:00
Tim Peters
bbf63cd05c Using marshal functions to pack & unpack 1-byte ints is an obscure &
expensive way to spell chr() and ord().
2003-01-27 21:15:36 +00:00
Tim Peters
22a449aacc Added a brief comment to each pickle opcode declaration. 2003-01-27 20:16:36 +00:00
Guido van Rossum
a72ded9bc8 Remove a stray quote. 2003-01-27 19:40:47 +00:00
Tim Peters
1996e23054 Repaired comment. 2003-01-27 19:38:34 +00:00
Tim Peters
d916cf4ec7 stringnl_noescape_pair(): changed the reader to separate the two
component strings by a blank instead of a period.  Guido pointed
out that the component strings (at least the first one) can be
dotted already.  find_class() is overridable too, so only God knows
all the possibilities that make sense to someone.
2003-01-27 19:01:47 +00:00
Tim Peters
8ecfc8ef9d Moving pickletools.py from the sandbox into the std library. I started
this over the weekend, and it made faster & better progress than I
expected -- it's already useful <wink>.
2003-01-27 18:51:48 +00:00
Tim Peters
40e1ce4d73 Repaired spelling of "test_iconv_codecs" in various expected-skip lists. 2003-01-27 16:45:03 +00:00
Andrew M. Kuchling
6ffdaab808 Remove the recently-added get_distutil_options(), and just
have two tuples listing the legal keywords for setup() and Extension()
2003-01-27 16:30:36 +00:00
Walter Dörwald
bf5170793c Fix comment typos 2003-01-27 15:57:14 +00:00
Martin v. Löwis
ca87aefe83 Patch #670715: Universal Unicode Codec for POSIX iconv. 2003-01-27 11:28:52 +00:00
Kurt B. Kaiser
7e17289868 Update for release.
Modified Files:
 	INSTALL.txt NEWS.txt idlever.py
2003-01-27 02:40:20 +00:00
Kurt B. Kaiser
e66675b85c Whitespace normalization.
Modified Files:
 	Bindings.py configHandler.py configHelpSourceEdit.py
2003-01-27 02:36:18 +00:00
Kurt B. Kaiser
d9db3a6713 Update. 2003-01-26 20:37:01 +00:00
Jack Jansen
db5ab80411 Path to default location for Python output has changed. 2003-01-26 20:33:46 +00:00
Jack Jansen
2b3ce3ba3f FSRef and EasyDialogs pathname support was pretty much broken in MacPython-OS9. Fixed. 2003-01-26 20:22:41 +00:00
Neal Norwitz
f4cdb474b6 amk pointed out that syslog may use UDP or TCP sockets.
Update to try UDP, if that fails, try TCP.
2003-01-26 16:15:24 +00:00
Martin v. Löwis
692d292c63 Test that True can be copied. 2003-01-26 11:32:44 +00:00
Martin v. Löwis
9789aefa61 Patch #670715: Universal Unicode Codec for POSIX iconv. 2003-01-26 11:30:36 +00:00
Martin v. Löwis
afef4eefa8 Require PyXML 0.8.2. 2003-01-26 10:36:33 +00:00
Martin v. Löwis
f8de21c51b Merge with PyXML 1.3:
Add support for the DOM Level 3 (draft) DOMImplementationSource interface
to the xml.dom and xml.dom.minidom modules.  Note API issue: the draft spec
says to return null when there is no suitable implementation, while the
Python getDOMImplementation() function raises ImportError (minor).
2003-01-26 09:04:35 +00:00
Martin v. Löwis
041411a1c7 Merge with PyXML 1.34: Correct typo. Fixes #674700. 2003-01-26 09:01:30 +00:00