| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
and left shifts. (Thanks to Kalle Svensson for SF patch 849227.)
This addresses most of the remaining semantic changes promised by
PEP 237, except for repr() of a long, which still shows the trailing
'L'. The PEP appears to promise warnings for operations that
changed semantics compared to Python 2.3, but this is not
implemented; we've suffered through enough warnings related to
hex/oct literals and I think it's best to be silent now.
|
|
|
|
|
| |
an exception raised by the key function.
(Suggested by Michael Hudson.)
|
| |
|
|
|
|
|
|
|
| |
than PySequence_Contains() and more clearly applicable to dicts.
Apply the new function in setobject.c where __contains__ checking is
ubiquitous.
|
| |
|
|
|
|
|
| |
unsigned int (on a 32-bit machine), by adding an explicit 'u' to the
literal (a prime used to improve the hash function for frozenset).
|
|
|
|
|
|
|
| |
* Add more tests
* Refactor and neaten the code a bit.
* Rename union_update() to update().
* Improve the algorithms (making them a closer to sets.py).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
function.
* Add a better test for deepcopying.
* Add tests to show the __init__() function works like it does for list
and tuple. Add related test.
* Have shallow copies of frozensets return self. Add related test.
* Have frozenset(f) return f if f is already a frozenset. Add related test.
* Beefed-up some existing tests.
|
|
|
|
|
|
|
|
|
|
| |
by the function object or by the method object, the function
object's attribute usually wins. Christian Tismer pointed out that
that this is really a mistake, because this only happens for special
methods (like __reduce__) where the method object's version is
really more appropriate than the function's attribute. So from now
on, all method attributes will have precedence over function
attributes with the same name.
|
|
|
|
| |
Brings the functionality back in line with sets.py.
|
|
|
|
| |
(Requested by Alex Martelli.)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Improve the hash function to increase the chance that distinct sets will
have distinct xor'd hash totals.
* Use PyDict_Merge where possible (it is faster than an equivalent iter/set
pair).
* Don't rebuild dictionaries where the input already has one.
|
|
|
|
|
|
|
|
| |
Also SF patch 843455.
This is a critical bugfix.
I'll backport to 2.3 maint, but not beyond that. The bugs this fixes
have been there since weakrefs were introduced.
|
| |
|
| |
|
| |
|
|
|
|
| |
variable, add extra braces).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* Install the unittests, docs, newsitem, include file, and makefile update.
* Exercise the new functions whereever sets.py was being used.
Includes the docs for libfuncs.tex. Separate docs for the types are
forthcoming.
|
|
|
|
|
| |
this change, I think subtype_dealloc is actually a smidgen less obscure
than it was in 2.3 -- we got rid of a negation in an "if" <wink>.
|
|
|
|
|
|
| |
expanded the test case with a piece that needs the more-complete fix.
I'll backport this to 2.3 maint.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
subtype_dealloc(): This left the dying object exposed to gc, so that
if cyclic gc triggered during the weakref callback, gc tried to delete
the dying object a second time. That's a disaster. subtype_dealloc()
had a (I hope!) unique problem here, as every normal dealloc routine
untracks the object (from gc) before fiddling with weakrefs etc. But
subtype_dealloc has obscure technical reasons for re-registering the
dying object with gc (already explained in a large comment block at
the bottom of the function).
The fix amounts to simply refraining from reregistering the dying object
with gc until after the weakref callback (if any) has been called.
This is a critical bug (hard to predict, and causes seemingly random
memory corruption when it occurs). I'll backport it to 2.3 later.
|
|
|
|
| |
is exhausted.
|
| |
|
| |
|
| |
|
|
|
|
| |
Also fix use of n for two different variables in two different blocks.
|
| |
|
| |
|
|
|
|
|
| |
SF patch 825639
http://mail.python.org/pipermail/python-dev/2003-October/039445.html
|
|
|
|
| |
had slightly different error messages.
|
|
|
|
|
|
|
| |
charmaptranslate_makespace() allocated more memory than required for the
next replacement but didn't remember that fact, so memory size was growing
exponentially every time a replacement string is longer that one character.
This fixes SF bug #828737.
|
|
|
|
| |
This closes SF bug #827260.
|
|
|
|
|
| |
Even if a new dict is generated for locals, it is stored in
f->f_locals.
|
| |
|
|
|
|
| |
(From SF patch #810751)
|
| |
|
|
|
|
| |
Backported to 2.3.
|
| |
|
| |
|
|
|
|
|
|
|
| |
key provides C support for the decorate-sort-undecorate pattern.
reverse provide a stable sort of the list with the comparisions reversed.
* Amended the docs to guarantee sort stability.
|
|
|
|
|
|
| |
* Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c)
* Py_BuildValue("()",a) --> PyTuple_New(0)
* Py_BuildValue("O", a) --> Py_INCREF(a)
|
|
|
|
|
| |
useful for rapidly building argument tuples without having to invoke the
more sophisticated machinery of Py_BuildValue().
|
|
|
|
| |
PyArg_ParseTuple() where possible.
|
|
|
|
|
|
| |
Altered to return a PyBool instead of a PyInt.
Backport candidate.
|
| |
|
| |
|