Commit Graph

31030 Commits

Author SHA1 Message Date
Barry Warsaw 2ec4854f13 Add documentation about as_string() mangling From_ lines. 2004-10-03 03:39:47 +00:00
Barry Warsaw 05bef930fa as_string(): Indicate that this mangles From_ lines. 2004-10-03 03:38:07 +00:00
Barry Warsaw bb11386730 Big email 3.0 API changes, with updated unit tests and documentation.
Briefly (from the NEWS file):

- Updates for the email package:
  + All deprecated APIs that in email 2.x issued warnings have been removed:
    _encoder argument to the MIMEText constructor, Message.add_payload(),
    Utils.dump_address_pair(), Utils.decode(), Utils.encode()
  + New deprecations: Generator.__call__(), Message.get_type(),
    Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
    the Parser constructor.  These will be removed in email 3.1.
  + Support for Python earlier than 2.3 has been removed (see PEP 291).
  + All defect classes have been renamed to end in 'Defect'.
  + Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
    added to messages that claim to be multipart but really aren't.
  + Updates to documentation.
2004-10-03 03:16:19 +00:00
Just van Rossum 2cdd608601 removed 2.2 support 2004-10-02 14:06:56 +00:00
Just van Rossum 16c3e08931 use new readPlist() and writePlist() functions 2004-10-02 14:06:18 +00:00
Armin Rigo 974d757af1 Upon insertion, if memory runs out, the deque was left in a corrupted state.
deque_item(): a performance bug: the linked list of blocks was followed
from the left in most cases, because the test (i < (deque->len >> 1)) was
after "i %= BLOCKLEN".

deque_clear(): replaced a call to deque_len() with deque->len; not sure what
this call was here for, nor if all compilers under the sun would inline it.

deque_traverse(): I belive that it could be called by the GC when the deque
has leftblock==rightblock==NULL, because it is tracked before the first block
is allocated (though closely before).  Still, a C extension module subclassing
deque could provide its own tp_alloc that could trigger a GC collection after
the PyObject_GC_Track()...

deque_richcompare(): rewrote to cleanly check for end-of-iterations instead of
relying on deque.__iter__().next() to succeed exactly len(deque) times -- an
assumption which can break if deques are subclassed.  Added a test.

I wonder if the length should be explicitely bounded to INT_MAX, with
OverflowErrors, as in listobject.c.  On 64-bit machines, adding more than
INT_MAX in the deque will result in trouble.  (Note to anyone/me fixing
this: carefully check for overflows if len is close to INT_MAX in the
following functions: deque_rotate(), deque_item(), deque_ass_item())
2004-10-02 13:59:34 +00:00
Raymond Hettinger 565ea5ae37 SF bug#1038917 fix typos (Contributed by George Yoshida.) 2004-10-02 11:02:59 +00:00
Raymond Hettinger 880430e2a5 Replace structure member before decreffing. 2004-10-02 10:56:43 +00:00
Just van Rossum 4c3d054d3d Which reminds me, I've had a much improved plistlib.py lying around for
ages. The main improvements are:
- a much more convenient API: readPlist() and writePlist()
- support non-dict top-level objects
2004-10-02 08:40:47 +00:00
Raymond Hettinger d1b3d88bf3 * Bulletproof the method for detecting mutations during iteration.
The previous approach was too easily fooled (a rotate() sufficed).

* Use it->counter to determine when iteration is complete.  The
  previous approach was too complex.

* Strengthen an assertion and add a comment here or there.
2004-10-02 00:43:13 +00:00
Raymond Hettinger 77e8bf1ca4 Restore the block length and add a comment. 2004-10-01 15:25:53 +00:00
Raymond Hettinger 4ca4c7c8cc Clarify the relationship between indices. 2004-10-01 15:14:39 +00:00
Raymond Hettinger 61f05fb96d * Elaborate on the invariant comments and make them more precise.
* Change the centering by one to make it possible to test the module
  with BLOCKLEN's as low as two.  Testing small blocks makes end-point
  errors surface more readily.
2004-10-01 06:24:12 +00:00
Tim Peters cf8997f6f8 Noted the fix to deque gc. 2004-10-01 02:13:16 +00:00
Tim Peters 10c7e86454 deque_traverse(): If the deque had one block, and its rightindex was
BLOCKLEN-1, this assert-failed in a debug build, or went wild with a
NULL pointer in a release build.  Reported on c.l.py by Stefan Behnel.
2004-10-01 02:01:04 +00:00
Tim Peters d6e0032768 Typos in new comments. 2004-10-01 01:35:54 +00:00
Tim Peters d8768d3294 Document some reverse-engineered invariants and pragmatic hints. 2004-10-01 01:32:53 +00:00
Greg Ward e644a1b921 Get references working (except for references to "Extending optparse",
which isn't being converted from reST yet).
2004-10-01 01:16:39 +00:00
Tim Peters 6f85356ff7 Definition consistency. 2004-10-01 01:04:50 +00:00
Tim Peters 1065f750cb Trimmed trailing whitespace. 2004-10-01 01:03:29 +00:00
Raymond Hettinger 7b46f6b2a5 Add tests for syntax errors. 2004-09-30 22:29:03 +00:00
Edward Loper 0fe00aafc3 Added 2 notes about the complexities of testing SyntaxErrors. 2004-09-30 17:18:18 +00:00
Raymond Hettinger 49c522be80 Expand scope to include general mapping protocol tests.
Many of these tests are redundant, but this will ensure
that the mapping protocols all stay in sync.
Also, added a test for dictionary subclasses.
2004-09-30 15:07:29 +00:00
Walter Dörwald 59b23e8b80 Add missing test_dict.py from patch #736962. 2004-09-30 13:46:00 +00:00
Raymond Hettinger 5ea7e31076 Improve test coverage. 2004-09-30 07:47:20 +00:00
Raymond Hettinger f751fa6195 SF bug #1035279: hex() and oct() documentation is incorrect
* Updated docs to reflected signed return values.
* Fixed a doubled word typo.
2004-09-30 00:59:08 +00:00
Raymond Hettinger fec0c466ad Improve error message for augmented assignments to genexps or listcomps.
Rather than introduce new logic, took the approach of making the message
itself more general.
2004-09-29 23:54:08 +00:00
Raymond Hettinger 8ffc1410e2 Fix two erroneous error messages. 2004-09-29 21:47:10 +00:00
Nicholas Bastin 975e725fc7 Fix typo in PyDict_Items doc 2004-09-29 21:39:26 +00:00
Raymond Hettinger ff5dc0ee77 Improve test coverage. 2004-09-29 11:40:50 +00:00
Raymond Hettinger bcab2b25f9 Improve test coverage. 2004-09-29 08:03:17 +00:00
Skip Montanaro 5497feefac minor doc tweaks for writexml 2004-09-28 18:40:42 +00:00
Skip Montanaro 67db9a5b72 typo 2004-09-28 18:30:03 +00:00
Raymond Hettinger 06cc973d06 Replaced a test with an assertion.
(Suggested by Michael Hudson.)
2004-09-28 17:22:12 +00:00
Tim Peters 01ba799244 A number of list examples used 66.6, but I doubt there's any box on which
repr(66.6) == "66.6", so doubt that the claimed output has ever been seen.
Changed it to 66.25 everywhere, and manually verified that the new claimed
output is correct.
2004-09-28 16:12:50 +00:00
Edward Loper 7d88a58e85 Reverted the addition of a NORMALIZE_NUMBERS option, per Tim Peter's
request.  Tim says that "correct 'fuzzy' comparison of floats cannot
be automated."  (The motivation behind adding the new option
was verifying interactive examples in Python's latex documentation;
several such examples use numbers that don't print consistently on
different platforms.)
2004-09-28 05:50:57 +00:00
Raymond Hettinger 4cda01e260 * Increase test coverage.
* Have groupby() be careful about decreffing structure members.
2004-09-28 04:45:28 +00:00
Edward Loper aec3c9b54f Added a new NORMALIZE_NUMBERS option, which causes number literals in
the expected output to match corresponding number literals in the
actual output if their values are equal (to ten digits of precision).
2004-09-28 04:29:57 +00:00
Brett Cannon bfef869510 Add note about inclusion of DarwinPorts directories in setup.py on darwin. 2004-09-28 04:08:11 +00:00
Brett Cannon 35b93d9720 Add the directories where DarwinPorts installs library and include files to
the proper path directories for compiling extension modules.
2004-09-28 03:49:52 +00:00
Edward Loper 1793dd31de Fixed minor typo in interactive example (extra '.'s in '...' prompts) 2004-09-28 03:12:01 +00:00
Edward Loper dcdb4b4d78 Fixed minor typo in interactive example (extra blank line) 2004-09-28 03:08:57 +00:00
Raymond Hettinger 78a5271d3e SF bug #1033038: Misleading error message in random.choice
Added a clarifying line to the docs.
2004-09-28 03:04:23 +00:00
Edward Loper ad512265a5 Fixed minor typo in interactive example 2004-09-28 02:56:45 +00:00
Edward Loper 3077b02ff4 Fixed minor typo in interactive example (backslash shouldn't be doubled) 2004-09-28 02:54:54 +00:00
Edward Loper a7f62814cf Updated interactive examples in the "Examples" session to reflect the
fact that compiler.ast.Function now takes a "decorators" argument.
2004-09-28 02:53:50 +00:00
Raymond Hettinger 87de0ca741 Silence a compiler warning by supplying the correct argument type to
the htons() function.
2004-09-28 02:19:40 +00:00
Raymond Hettinger 6429a4727e Use Py_CLEAR(). Add unrelated test. 2004-09-28 01:51:35 +00:00
Greg Ward b6f7fb7327 Major overhaul to reflect Optik 1.5. Section references currently broken. 2004-09-28 01:30:23 +00:00
Raymond Hettinger 855d9a985b Plug a leak and beef-up test coverage. 2004-09-28 00:03:54 +00:00