Commit Graph

30975 Commits

Author SHA1 Message Date
Raymond Hettinger ffdb8bb99c Use floor division operator. 2004-09-27 15:29:05 +00:00
Raymond Hettinger 4837a223ee Use floor division operator. 2004-09-27 14:23:40 +00:00
Edward Loper a4c6a8522c - Added a "parser" option to testfile() and DocFileTest(). 2004-09-27 04:08:20 +00:00
Edward Loper 498a1868e7 - Added a "parser" option to testfile() and DocFileTest(). 2004-09-27 03:42:58 +00:00
Edward Loper 456ff91664 - Fixed typo in multi-line exception example
- Fixed indentation for a verbatim block
2004-09-27 03:30:44 +00:00
Tim Peters 36ee8ce373 Give a saner example for script_from_examples(); also mention an intended
but not entirely obvious use case.
2004-09-26 21:51:25 +00:00
Tim Peters 9463d8761b Made most module references "clickable". 2004-09-26 21:05:03 +00:00
Tim Peters 0041121c25 Docs for run_docstring_examples(). 2004-09-26 20:45:04 +00:00
Raymond Hettinger aa241e0149 Checkin Tim's fix to an error discussed on python-dev.
Also, add a testcase.

Formerly, the list_extend() code used several local variables to remember
its state across iterations.  Since an iteration could call arbitrary
Python code, it was possible for the list state to be changed.  The new
code uses dynamic structure references instead of C locals.  So, they
are always up-to-date.

After list_resize() is called, its size has been updated but the new
cells are filled with NULLs.  These needed to be filled before arbitrary
iteration code was called; otherwise, that code could attempt to modify
a list that was in a semi-invalid state.  The solution was to change
the ob->size field back to a value reflecting the actual number of valid
cells.
2004-09-26 19:24:20 +00:00
Raymond Hettinger 55593c3ef5 Make the regex pattern easier to read, understand, and modify
by factoring out the common prefix (the delimiter).
2004-09-26 18:56:44 +00:00
Martin v. Löwis 4d9559a47e Replace -soname with -h for Solaris compatibility. Fixes #1034496.
Backported to 2.3.
2004-09-26 17:26:55 +00:00
Tim Peters a80a2c8e67 Updated doctest doc news. 2004-09-26 05:13:18 +00:00
Tim Peters 05b05febad Added a lot of new stuff to the debugging section. 2004-09-26 05:09:59 +00:00
Tim Peters 3afaaf2487 Removed debug_script from the public API: no docs, not public. I'm in
the process of writing docs for the other "missing" debug support
functions.
2004-09-26 03:50:06 +00:00
Tim Peters 16be62f054 register_optionflag(): Moved from the Debugging section to the section
on option flags; added a versionadded decoration.
2004-09-26 02:38:41 +00:00
Tim Peters 6a0a64b7ad Document set_unittest_reportflags(). 2004-09-26 02:12:40 +00:00
Tim Peters 9d02a7cfa0 Add set_unittest_reportflags() to the public API. Docs will follow
"soon", after I repair the LaTeX I somehow damaged.
2004-09-26 01:50:24 +00:00
Tim Peters 261b28aac6 Removed two undocumented unittest support classes, and one undocumented
unittest support function, from the public interface.  If they're not
documented, they shouldn't be public.
2004-09-26 01:24:23 +00:00
Raymond Hettinger c90ea82302 Fix double word error. 2004-09-25 08:09:23 +00:00
Tim Peters 3f7912521d Assorted minor changes, plus a lot more soap. 2004-09-25 03:50:35 +00:00
Tim Peters 8c0a2cf938 Explain the motivation for the unittest functions, and beef up the
example.  Squash repeated argument descriptions.  Minor rewordings.
2004-09-25 03:02:23 +00:00
Tim Peters 48983fc484 Removed most of the module docstring. There's too much to explain now,
and the LaTeX docs are in increasingly good shape.
2004-09-25 02:41:28 +00:00
Tim Peters b2b26aca13 Repaired mistakes in the descriptions of testmod()/testfile(), and
squashed massive duplication of common argument descriptions.
2004-09-25 01:51:49 +00:00
Brett Cannon 35ae3dd5aa Add warning notation about using 'bomb' setting. 2004-09-25 01:39:56 +00:00
Brett Cannon a5ca2e7220 Remove 'extern' declaration for _Py_SwappedOp. 2004-09-25 01:37:24 +00:00
Tim Peters 2dc820599b Since the doctest warnings section was reduced to one bullet point,
get rid of the itemize structure.
2004-09-25 01:30:16 +00:00
Tim Peters 39c5de0376 In the "doctest warnings" section, removed obsolete info, and noted that
ELLIPSIS can be used to deal with examples that embed object addresses.
2004-09-25 01:22:29 +00:00
Johannes Gijsbers 24f141ab46 Raymond observed that sometimes it's better not to link modules, so I reverted
part of my previous last changes.
2004-09-25 00:55:38 +00:00
Tim Peters 06cc847cee Beef up the section on testfile(), giving a complete example in
reStructuredText format.  Remove words describing the return value of
testmod() and testfile() in the intro sections, since it's never
useful in such simple cases.
2004-09-25 00:49:53 +00:00
Tim Peters cac5e7b81d Typo. 2004-09-25 00:11:43 +00:00
Tim Peters 7a082142d8 Since the LaTeX isn't doctest'ed, examples are always wrong <wink>. 2004-09-25 00:10:53 +00:00
Johannes Gijsbers 27ebcae450 - Use itemize instead of plain-text '*' for marking up a list.
- Add more ulink's to modules (this should probably become a standard macro).
2004-09-24 23:25:25 +00:00
Tim Peters 5a59d88e89 Whitespace normalization. 2004-09-24 23:16:41 +00:00
Johannes Gijsbers 3981511070 Port test_unpack to doctest (patch #736962). 2004-09-24 21:36:52 +00:00
Neil Schemenauer 6bc937cfd2 Add yet more tests for buffer(). 2004-09-24 19:18:42 +00:00
Neil Schemenauer 927a57fbeb Ensure negative offsets cannot be passed to buffer(). When composing
buffers, compute the new buffer size based on the old buffer size.
Fixes SF bug #1034242.
2004-09-24 19:17:26 +00:00
Neil Schemenauer fb6ba07d9c Fix buffer offset calculation (need to compute it before changing
'base').  Fixes SF bug #1033720.  Move offset sanity checking to
buffer_from_memory().
2004-09-24 15:41:27 +00:00
Neil Schemenauer 29302a7867 Add a few more tests for the buffer() object. 2004-09-24 15:35:15 +00:00
Vinay Sajip 739d49e39b Added log() function documentation 2004-09-24 11:46:44 +00:00
Vinay Sajip b2635b2f71 Added log() function 2004-09-24 11:45:52 +00:00
Vinay Sajip 02dd994adf Added exception handling during handler initialization in fileConfig() 2004-09-24 11:45:13 +00:00
Tim Peters 1cc37380b2 Whitespace normalization. 2004-09-24 04:36:47 +00:00
Raymond Hettinger 9447874131 Add docstrings for regular expression objects and methods. 2004-09-24 04:31:19 +00:00
Raymond Hettinger 596ba4d89e Granted Noam Raphael's request for minor improvements to the re module and
its documentation.

* Documented that the compiled re methods are supposed to be more full
  featured than their simpilified function counterparts.

* Documented the existing start and stop position arguments for the
  findall() and finditer() methods of compiled regular expression objects.

* Added an optional flags argument to the re.findall() and re.finditer()
  functions.  This aligns their API with that for re.search() and
  re.match().
2004-09-24 03:41:05 +00:00
Andrew M. Kuchling 9fa544cfa3 Update for beta1 2004-09-23 20:17:26 +00:00
Andrew M. Kuchling 0c7895617f Add various items 2004-09-23 20:15:41 +00:00
Tim Peters e1c69b3f6f float_richcompare(): Use the new Py_IS_NAN macro to ensure that, on
platforms where that macro works, NaN compared to an int or long works
the same as NaN compared to a finite float.
2004-09-23 19:22:41 +00:00
Tim Peters 862f0593d8 Introduced a Py_IS_NAN macro, which probably works on the major platforms
today.  pyconfig.h can override it if not, and can also override
Py_IS_INFINITY now.  Py_IS_NAN and Py_IS_INFINITY are overridden now
for Microsoft compilers, using efficient MS-specific spellings.
2004-09-23 19:11:32 +00:00
Tim Peters 307fa78107 SF bug #513866: Float/long comparison anomaly.
When an integer is compared to a float now, the int isn't coerced to float.
This avoids spurious overflow exceptions and insane results.  This should
compute correct results, without raising spurious exceptions, in all cases
now -- although I expect that what happens when an int/long is compared to
a NaN is still a platform accident.

Note that we had potential problems here even with "short" ints, on boxes
where sizeof(long)==8.  There's #ifdef'ed code here to handle that, but
I can't test it as intended.  I tested it by changing the #ifdef to
trigger on my 32-bit box instead.

I suppose this is a bugfix candidate, but I won't backport it.  It's
long-winded (for speed) and messy (because the problem is messy).  Note
that this also depends on a previous 2.4 patch that introduced
_Py_SwappedOp[] as an extern.
2004-09-23 08:06:40 +00:00
Raymond Hettinger 4533f1fb7f Improve three recipes in the itertools docs. 2004-09-23 07:27:39 +00:00