Commit Graph

2712 Commits

Author SHA1 Message Date
Raymond Hettinger
c601117f38 SF bug #812202: randint is always even
* Extend rangrange() to return meaningful results when the range is
  larger than 2**53.  Only applies to the MersenneTwister.  WichmannHill
  was left alone in the absence of a proof showing how multiple calls
  could be combined to produce long bit streams.

* WichmannHill was missing from __all__.
2003-10-05 23:35:38 +00:00
Raymond Hettinger
bd79d846f4 Adopt Christian Stork's suggested argument order for quantifier examples.
Adopt Jeremy Fincher's suggested function name, "any", instead of "some".
2003-10-05 23:05:56 +00:00
Raymond Hettinger
54ab431398 Backport Tim's fix to test_winsound.py
PlaySoundTest.test_alias_fallback():  Disabled this test, and explained
why in a new comment.  My home Win98SE box is one of the "real systems"
alluded to (my system "default sound" appears to have vanished sometime
in the last month, that's certainly not a Python bug, and the MS
PlaySound docs are correct in their explanation of what happens then).
2003-09-22 19:14:49 +00:00
Raymond Hettinger
08ae590113 Backport Tim's fix to SF #809915.
Creates a url that should always be invalid.
2003-09-21 04:38:33 +00:00
Raymond Hettinger
4737992e8c Fix documentation bugs.
Add support for iterators and other mapping methods.
Convert tests to unittest format and expand their coverage.
2003-09-16 21:42:13 +00:00
Raymond Hettinger
675bac026e Backport addition of the __all__ attribute for unittest.py 2003-09-16 04:55:32 +00:00
Skip Montanaro
7b7a9fd7d2 **kwds arg was missing from __init__ for Dict{Reader,Writer} classes. 2003-09-06 19:52:28 +00:00
Raymond Hettinger
0b0aae087a SF bug #801342: Bug (documentation or real, your choice) in random.sample.
random.sample() uses one of two algorithms depending on the ratio of the
sample size to the population size.  One of the algorithms accepted any
iterable population argument so long as it defined __len__().  The other
had a stronger requirement that the population argument be indexable.

While it met the documentation specifications which insisted that the
population argument be a sequence, it made random.sample() less usable
with sets.  So, the second algorithm was modified to coerce non-indexable
iterables and dictionaries into a tuple before proceeding.
2003-09-05 21:40:30 +00:00
Raymond Hettinger
4595b6b35d Only apply case-insensitivity test on appropriate platforms.' test_filecmp.py 2003-09-02 07:01:11 +00:00
Raymond Hettinger
c6c1a154cc SF bug #453515: filecmp.dircmp case sensitivity bug 2003-09-02 05:47:17 +00:00
Raymond Hettinger
6437a618b1 Fix failing test 2003-09-02 04:19:02 +00:00
Raymond Hettinger
81114e4808 SF bug #785222: zlib monotonic test
For smaller datasets, it is not always true the increasing the compression
level always results in better compression.  Removed the test which made
this invalid assumption.
2003-08-31 04:37:25 +00:00
Raymond Hettinger
9ea45c88da * Add news item for the previous bugfix
* Backport itertoolsmodule.c 1.19 to re-sync Py2.3.1 with Py2.4.
2003-08-30 22:16:59 +00:00
Raymond Hettinger
48ced318cd SF bug 797650: Infinite loop in textwrap.py
When the indents were set to longer than the width and long word breaking
was enabled, an infinite loop would result because the inner loop did not
assure that at least one character was stripped off on every pass.
2003-08-30 14:52:35 +00:00
Raymond Hettinger
2e61662290 SF bug #793826: using itertools.izip to mutate tuples
Avoid Armin Rigo's dastardly exercise in re-entrancy.
2003-08-29 23:13:16 +00:00
Brett Cannon
3b47b812ca _strptime.srptime() escaped parentheses in the format string properly.
Closes bug #796149 .
2003-08-29 02:34:22 +00:00
Raymond Hettinger
eb85c6617b SF bug #795506: Wrong handling of string format code for float values.
Added missing support for '%F' as had been documented.
2003-08-27 05:08:19 +00:00
Jason Tishler
c519f015f2 test_largefile can leave its temp file open if one of many tests fail. On
platforms (e.g., Cygwin) that are "particular" about open files, this will
cause other regression tests that use the same temp file to fail:

    $ ./python.exe -E -tt Lib/test/regrtest.py -l
    test_largefile test_mmap test_mutants
    test_largefile
    test test_largefile failed -- got -1794967295L, but expected 2500000001L
    test_mmap
    test test_mmap crashed -- exceptions.IOError: [Errno 13] Permission denied: '@test'
    test_mutants
    test test_mutants crashed -- exceptions.IOError: [Errno 13] Permission denied: '@test'

This patch solves the problem by adding missing "try/finally" blocks. Note
that the "large" size of this patch is due to many white space changes --
otherwise, the patch is small.

I tested this patch under Red Hat Linux 8.0 too.
2003-08-26 11:59:41 +00:00
Raymond Hettinger
27ea5783b3 Backport improvements to set.py so that the interface will remain
consistent across versions.

* Relaxed the argument restrictions for non-operator methods.  They now
  allow any iterable instead of requiring a set.  This makes the module
  a little easier to use and paves the way for an efficient C
  implementation which can take better advantage of iterable arguments
  while screening out immutables.

* Added a PendingDeprecationWarning for Set.update() because it now
  duplicates Set.union_update()

* Adapted the tests and docs to include the above changes.

* Added more test coverage including testing identities and checking
  to make sure non-restartable generators work as arguments.
2003-08-17 22:08:58 +00:00
Walter Dörwald
33f6aebeed Backport checkin:
Make a copy of L before appending, so the global L remains
unchanged (and sys.gettotalrefcount() remains constant).

Fix a few typos.
2003-08-15 17:36:25 +00:00
Walter Dörwald
0098d86433 Backport checkins:
* Enhance message for UnicodeEncodeError and UnicodeTranslateError.
  If there is only one bad character it will now be printed in a
  form that is a valid Python string.
* Add a unicode prefix to the characters in the UnicodeEncodeError
  and UnicodeTranslateError message.
2003-08-12 17:38:22 +00:00
Jason Tishler
03474027a3 Unconditionally opening the temp file in text mode causes this test to fail
under Cygwin. The attached patch corrects this problem.

I tested this patch under Red Hat Linux 8.0 too.
2003-08-11 12:13:45 +00:00
Brett Cannon
79ca4a4194 Fix bug where handling issue of time.tzname[0] == time.tzname[1] and
time.daylight were all true.  Add an explicit test for this issue.

Closes bug #783952 .
2003-08-11 07:19:06 +00:00
Raymond Hettinger
8cf915e9fb SF bug #778964: bad seed in python 2.3 random
The default seed is time.time().
Multiplied by 256 before truncating so that fractional seconds are used.
This way, two consequetive calls to random.seed() are much more likely
to produce different sequences.
2003-08-09 18:20:16 +00:00
Raymond Hettinger
f45fe222d3 SF bug #770485: cStringIO does not set closed attr 2003-08-08 12:22:30 +00:00