| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
make obj.__contains__() returns True/False instead of 1/0.
|
|
|
|
|
|
|
| |
* Added C coded getrandbits(k) method that runs in linear time.
* Call the new method from randrange() for ranges >= 2**53.
* Adds a warning for generators not defining getrandbits() whenever they
have a call to randrange() with too large of a population.
|
| |
|
|
|
|
| |
assuming it is the variable f.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
as internal unicode type base for Py_UNICODE since the unicode implementation assumes an unsigned type.
|
| |
|
|
|
|
| |
Not backported because of behaviour change.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a length-1 Unicode string was in the freelist and it was
uninitialized or pointed to a very large (magnitude) negative number,
the check
unicode_latin1[unicode->str[0]] == unicode
could cause a segmentation violation, e.g. unicode->str[0] is 0xcbcbcbcb.
Fix this in two ways:
1. Change guard befor unicode_latin1[] to test against 256U. If I
understand correctly, the unsigned long used to store UCS4 on my
box was getting converted to a signed long to compare with the
signed constant 256.
2. Change _PyUnicode_New() to make sure the first element of str is
always initialized to zero. There are several places in the code
where the caller can exit with an error before initializing any
of str, which would leave junk in str[0].
Also, silence a compiler warning on pointer vs. int arithmetic.
Bug fix candidate.
|
|
|
|
|
|
| |
Add support for the iterator and mapping protocols.
For Py2.3, this was done for shelve, dumbdbm and other mapping objects, but
not for bsddb and dbhash which were inadvertently missed.
|
|
|
|
|
|
| |
its first three arguments.
Closes RFE #798046 .
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
file_truncate(): C doesn't define what fflush(fp) does if fp is open
for update, and the preceding I/O operation on fp was input. On Windows,
fflush() actually changes the current file position then. Because
Windows doesn't support ftruncate() directly, this not only caused
Python's file.truncate() to change the file position (contra our docs),
it also caused the file not to change size.
Repaired by getting the initial file position at the start, restoring
it at the end, and tossing all the complicated micro-efficiency checks
trying to avoid "provably unnecessary" seeks. file.truncate() can't
be a frequent operation, and seeking to the current file position has
got to be cheap anyway.
Bugfix candidate.
|
|
|
|
| |
will backport.
|
| |
|
| |
|
|
|
|
| |
(Contributed by Alexander Belopolsky.)
|
|
|
|
|
|
| |
(Contributed by Andrew Gaul.)
Fixes a minor leak.
|
|
|
|
| |
(Contributed by George Yoshida.)
|
|
|
|
|
|
| |
Adding missing support for '%F'.
Will backport to 2.3.1.
|
| |
|
| |
|
|
|
|
|
|
|
| |
which is a disaster on Windows. Restored the binary default of all
previous releases. Also minor code cleanups.
Bugfix candidate!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
* Deprecated 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.
Will backport to Py2.3.1 so that the interface remains consistent
across versions. The deprecation of update() will be changed to
a FutureWarning.
|
| |
|
|
|
|
|
|
| |
number. This accounts for the 2 refcount leaks per test_complex run
Michael Hudson discovered (I figured only I would have the stomach to
look for leaks in floating-point code <wink>).
|
| |
|
| |
|
|
|
|
|
|
|
| |
The default seed is time.time().
Multiplied by 256 before truncating so that fractional seconds are used.
This way, two successive calls to random.seed() are much more likely
to produce different sequences.
|
| |
|
|
|
|
| |
which can now take zero arguments.
|
| |
|
| |
|
| |
|
|
|
|
| |
by returning an empty list instead of raising a TypeError.
|
| |
|
| |
|
| |
|
|
|
|
| |
submitted by Bernard Herzog. Closes patch 779830.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The fix is confined to the Windows installer.
Not a bugfix candidate: the need for the new -n switch added here was
introduced by moving to the idlefork IDLE (so this change isn't needed
or helpful before 2.3).
|
|
|
|
| |
a wrong place over the weekend.
|
|
|
|
| |
blurb about ZoneAlarm (etc) nags.
|
| |
|
|
|
|
| |
during the day tomorrow, so doing it earlier than I'd like.
|