COLLECTED BY
Organization:
Internet Archive
The Internet Archive discovers and captures web pages through many different web crawls.
At any given time several distinct crawls are running, some for months, and some every day or longer.
View the web archive through the
Wayback Machine.
The Wayback Machine - https://web.archive.org/web/20170224204758/http://svn.python.org/view/python/trunk/Objects/setobject.c
Log of /python/trunk/Objects/setobject.c
Parent Directory
|
Revision Log
Revision
78515 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Feb 28 18:19:17 2010 UTC
(6 years, 11 months ago)
by
georg.brandl
File length: 59356 byte(s)
Diff to
previous 76382
#8030: make builtin type docstrings more consistent: use "iterable" instead of "seq(uence)", use "new" to show that set() always returns a new object.
Revision
66836 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Oct 7 20:32:10 2008 UTC
(8 years, 4 months ago)
by
amaury.forgeotdarc
File length: 59165 byte(s)
Diff to
previous 66772
#4069: aSet.remove(otherSet) would always report the empty frozenset([]) as the missing key.
Now it correctly refers to the initial otherset.
Reviewed by Raymond. Will backport to 2.6.
Revision
64962 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jul 15 14:27:37 2008 UTC
(8 years, 7 months ago)
by
nick.coghlan
File length: 59120 byte(s)
Diff to
previous 64853
Issue 2235: __hash__ is once again inherited by default, but inheritance can be blocked explicitly so that collections.Hashable remains meaningful
Revision
63806 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri May 30 06:49:47 2008 UTC
(8 years, 8 months ago)
by
raymond.hettinger
File length: 56751 byte(s)
Diff to
previous 63675
Issue 2855: Fix obscure crasher by slowing down the entire module. Mimics what was done to dictionaries in r59223.
Revision
60616 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Feb 6 13:33:44 2008 UTC
(9 years ago)
by
christian.heimes
File length: 56679 byte(s)
Diff to
previous 60560
Unified naming convention for free lists and their limits. All free lists
in Object/ are named ``free_list``, the counter ``numfree`` and the upper
limit is a macro ``PyName_MAXFREELIST`` inside an #ifndef block.
The chances should make it easier to adjust Python for platforms with
less memory, e.g. mobile phones.
Revision
60560 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Feb 3 22:51:43 2008 UTC
(9 years ago)
by
amaury.forgeotdarc
File length: 56677 byte(s)
Diff to
previous 60399
Ensure that PySet_Add() operates on a newly created frozenset, like PyTuple_SetItem does.
Add PyFrozenSet_Check(), which was not needed before; The list of Py*Set_Check* macros seems to be complete now.
Add missing NEWS entries about all this.
Revision
60397 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jan 28 20:34:33 2008 UTC
(9 years ago)
by
raymond.hettinger
File length: 56600 byte(s)
Diff to
previous 60312
Make PySet_Add() work with frozensets.
Works like PyTuple_SetItem() to build-up values in a brand new frozenset.
Also, PyFrozenSet_New() is now guaranteed to produce a distinct new frozenset.
Revision
60308 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jan 26 08:19:06 2008 UTC
(9 years, 1 month ago)
by
raymond.hettinger
File length: 56769 byte(s)
Diff to
previous 60291
Make PySet_Add() work with frozensets. Works like PyTuple_SetItem() to build-up values in a brand new frozenset.
Revision
60291 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 25 19:24:46 2008 UTC
(9 years, 1 month ago)
by
raymond.hettinger
File length: 56865 byte(s)
Diff to
previous 59564
Changes 54857 and 54840 broke code and were reverted in Py2.5 just before
it was released, but that reversion never made it to the Py2.6 head.
Revision
59564 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Dec 19 02:37:44 2007 UTC
(9 years, 2 months ago)
by
christian.heimes
File length: 56900 byte(s)
Diff to
previous 59106
#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT. Macros for b/w compatibility are available.
Revision
59106 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Nov 22 00:55:51 2007 UTC
(9 years, 3 months ago)
by
guido.van.rossum
File length: 56900 byte(s)
Diff to
previous 58915
Backport of _abccoll.py by Benjamin Arangueren, issue 1383.
With some changes of my own thrown in (e.g. backport of r58107).
Revision
58176 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Sep 17 03:28:34 2007 UTC
(9 years, 5 months ago)
by
brett.cannon
File length: 55662 byte(s)
Diff to
previous 56476
Add a bunch of GIL release/acquire points in tp_print implementations and for
PyObject_Print().
Closes issue #1164.
Revision
56476 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jul 21 06:55:02 2007 UTC
(9 years, 7 months ago)
by
martin.v.loewis
File length: 55474 byte(s)
Diff to
previous 55227
PEP 3123: Provide forward compatibility with Python 3.0, while keeping
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
Revision
54465 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 20 21:27:24 2007 UTC
(9 years, 11 months ago)
by
raymond.hettinger
File length: 55509 byte(s)
Diff to
previous 53829
Extend work on rev 52962 and 53829 eliminating redundant PyObject_Hash() calls and fixing set/dict interoperability.
Revision
52964 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Dec 8 04:57:50 2006 UTC
(10 years, 2 months ago)
by
raymond.hettinger
File length: 54224 byte(s)
Diff to
previous 52963
Port Georg's dictobject.c fix keys that were tuples got unpacked on the way to setting a KeyError (svn revision 52535, sf bug
1576657).
Revision
52502 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Oct 28 21:16:54 2006 UTC
(10 years, 4 months ago)
by
neal.norwitz
File length: 52752 byte(s)
Diff to
previous 51798
Fix warnings with HP's C compiler. It doesn't recognize that infinite
loops are, um, infinite. These conditions should not be able to happen.
Will backport.
Revision
50934 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jul 29 15:10:32 2006 UTC
(10 years, 7 months ago)
by
andrew.kuchling
File length: 52280 byte(s)
Diff to
previous 50684
[Bug #1414697] Change docstring of set/frozenset types to specify that the contents are unique. Raymond, please feel free to edit or revert.
Revision
50684 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 17 00:57:15 2006 UTC
(10 years, 7 months ago)
by
neal.norwitz
File length: 52242 byte(s)
Diff to
previous 47018
otherset is known to be non-NULL based on checks before and DECREF after.
DECREF otherset rather than XDECREF in error conditions too.
Reported by Klockwork #154.
Revision
45434 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Apr 15 12:47:23 2006 UTC
(10 years, 10 months ago)
by
martin.v.loewis
File length: 52130 byte(s)
Diff to
previous 45312
Clear dummy and emptyfrozenset, so that we don't have
dangling references in case of a Py_Initialize/Py_Finalize
cycle.
Revision
45312 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Apr 12 17:06:05 2006 UTC
(10 years, 10 months ago)
by
armin.rigo
File length: 52134 byte(s)
Diff to
previous 45275
Ignore the references to the dummy objects used as deleted keys
in dicts and sets when computing the total number of references.
Revision
43465 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 30 22:45:35 2006 UTC
(10 years, 10 months ago)
by
barry.warsaw
File length: 52108 byte(s)
Diff to
previous 43453
SF patch #1458476 with modifications based on discussions in python-dev. This
adds the following API calls: PySet_Clear(), _PySet_Next(), and
_PySet_Update(). The latter two are considered non-public. Tests and
documentation (for the public API) are included.
Revision
39553 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 16 07:14:21 2005 UTC
(11 years, 5 months ago)
by
rhettinger
File length: 50346 byte(s)
Diff to
previous 39400
No longer ignore exceptions raised by comparisons during key lookup.
Inspired by Armin Rigo's suggestion to do the same with dictionaries.
Revision
39349 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Aug 24 00:24:40 2005 UTC
(11 years, 6 months ago)
by
rhettinger
File length: 50803 byte(s)
Diff to
previous 39294
* Add a fast equality check path for frozensets where the hash value has
already been computed.
* Apply a GET_SIZE macro().
Revision
39290 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Aug 17 00:27:42 2005 UTC
(11 years, 6 months ago)
by
rhettinger
File length: 50674 byte(s)
Diff to
previous 39289
Results of a line-by-line comparison back to dictobject.c.
* set_merge() cannot assume that the table doesn't resize during iteration.
* convert some unnecessary tests to asserts -- they were necessary in
dictobject.c because PyDict_Next() is a public function. The same is
not true for set_next().
* re-arrange the order of functions to more closely match the order
in dictobject.c. This makes it must easier to compare the two
and ought to simplify any issues of maintaining both.
Revision
39280 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Aug 13 08:28:03 2005 UTC
(11 years, 6 months ago)
by
rhettinger
File length: 46377 byte(s)
Diff to
previous 39273
* Bring lookkey() and lookkey_string() closer to dict version.
* Use set_next() for looping in issubset() and frozenset_hash().
* Re-order the presentation of cmp and hash functions.
Revision
39273 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 12 20:48:39 2005 UTC
(11 years, 6 months ago)
by
rhettinger
File length: 46866 byte(s)
Diff to
previous 39269
* Fix SF #1257731. Make __contains__(), remove(), and discard() only do
a frozenset conversion when the initial search attempt fails with a
TypeError and the key is some type of set. Add a testcase.
* Eliminate a duplicate if-stmt.
Revision
39269 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Aug 11 07:58:45 2005 UTC
(11 years, 6 months ago)
by
rhettinger
File length: 46751 byte(s)
Diff to
previous 39262
* Add short-circuit code for in-place operations with self (such as
s|=s, s&=s, s-=s, or s^=s). Add related tests.
* Improve names for several variables and functions.
* Provide alternate table access functions (next, contains, add, and discard)
that work with an entry argument instead of just a key. This improves
set-vs-set operations because we already have a hash value for each key
and can avoid unnecessary calls to PyObject_Hash(). Provides a 5% to 20%
speed-up for quick hashing elements like strings and integers. Provides
much more substantial improvements for slow hashing elements like tuples
or objects defining a custom __hash__() function.
* Have difference operations resize() when 1/5 of the elements are dummies.
Formerly, it was 1/6. The new ratio triggers less frequently and only
in cases that it can resize quicker and with greater benefit. The right
answer is probably either 1/4, 1/5, or 1/6. Picked the middle value for
an even trade-off between resize time and the space/time costs of dummy
entries.
Revision
39262 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Aug 7 13:02:53 2005 UTC
(11 years, 6 months ago)
by
rhettinger
File length: 45377 byte(s)
Diff to
previous 39258
* Bring in INIT_NONZERO_SET_SLOTS macro from dictionary code.
* Bring in free list from dictionary code.
* Improve several comments.
* Differencing can leave many dummy entries. If more than
1/6 are dummies, then resize them away.
* Factor-out common code with new macro, PyAnySet_CheckExact.
Revision
39258 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Aug 6 18:57:13 2005 UTC
(11 years, 6 months ago)
by
rhettinger
File length: 44300 byte(s)
Diff to
previous 39257
* Removed checked_error flag which no longer provides any benefit.
* Have issubset() control its own loop instead of using set_next_internal().
Revision
39257 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Aug 6 18:31:24 2005 UTC
(11 years, 6 months ago)
by
rhettinger
File length: 44367 byte(s)
Diff to
previous 39256
* set_new() doesn't need to zero the structure a second time after tp_alloc
has already done the job.
* Use a macro form of PyErr_Occurred() inside the set_lookkey() function.
Revision
39253 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 5 17:19:54 2005 UTC
(11 years, 6 months ago)
by
rhettinger
File length: 44277 byte(s)
Diff to
previous 39252
* Improve a variable name: entry0 --> table.
* Give set_lookkey_string() a fast alternate path when no dummy entries
are present.
* Have set_swap_bodies() reset the hash field to -1 whenever either of
bodies is not a frozenset. Maintains the invariant of regular sets
always having -1 in the hash field; otherwise, any mutation would make
the hash value invalid.
* Use an entry pointer to simplify the code in frozenset_hash().
Revision
39252 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 5 00:01:15 2005 UTC
(11 years, 6 months ago)
by
rhettinger
File length: 43689 byte(s)
Diff to
previous 39242
* Move copyright notice to top and indicate derivation from sets.py and
dictobject.c.
* Have frozenset_hash() use entry->hash instead of re-computing each
individual hash with PyObject_Hash(o);
* Finalize the dummy entry before a system exit.
Revision
39238 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Aug 1 21:39:29 2005 UTC
(11 years, 6 months ago)
by
rhettinger
File length: 43113 byte(s)
Diff to
previous 39237
* Improve code for the empty frozenset singleton:
- Handle both frozenset() and frozenset([]).
- Do not use singleton for frozenset subclasses.
- Finalize the singleton.
- Add test cases.
* Factor-out set_update_internal() from set_update(). Simplifies the
code for several internal callers.
* Factor constant expressions out of loop in set_merge_internal().
* Minor comment touch-ups.
Revision
39233 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Jul 31 01:16:36 2005 UTC
(11 years, 6 months ago)
by
rhettinger
File length: 41973 byte(s)
Diff to
previous 39036
Revised the set() and frozenset() implementaion to use its own internal
data structure instead of using dictionaries. Reduces memory consumption
by 1/3 and provides modest speed-ups for most set operations.
Revision
36141 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jun 10 22:41:48 2004 UTC
(12 years, 8 months ago)
by
rhettinger
File length: 26079 byte(s)
Diff to
previous 36140
Futher improvements to frozenset hashing (based on Yitz Gale's battery of
tests which nicely highly highlight weaknesses).
* Initial value is now a large prime.
* Pre-multiply by the set length to add one more basis of differentiation.
* Work a bit harder inside the loop to scatter bits from sources that
may have closely spaced hash values.
All of this is necessary to make up for keep the hash function commutative.
Fortunately, the hash value is cached so the call to frozenset_hash() will
only occur once per set.
Revision
36140 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jun 10 21:38:41 2004 UTC
(12 years, 8 months ago)
by
rhettinger
File length: 26001 byte(s)
Diff to
previous 35979
Fixups to the hash function for frozensets.
* Non-zero initial value so that hash(frozenset()) != hash(0).
* Final permutation to differentiate nested sets.
* Add logic to make sure that -1 is not a possible hash value.
Revision
34896 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Dec 13 11:26:12 2003 UTC
(13 years, 2 months ago)
by
rhettinger
File length: 27332 byte(s)
Diff to
previous 34738
* Added a new method flag, METH_COEXIST.
* Used the flag to optimize set.__contains__(), dict.__contains__(),
dict.__getitem__(), and list.__getitem__().
Revision
34738 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Nov 25 21:12:14 2003 UTC
(13 years, 3 months ago)
by
rhettinger
File length: 26648 byte(s)
Diff to
previous 34734
Expose dict_contains() and PyDict_Contains() with is about 10% faster
than PySequence_Contains() and more clearly applicable to dicts.
Apply the new function in setobject.c where __contains__ checking is
ubiquitous.
Revision
34730 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Nov 24 04:13:13 2003 UTC
(13 years, 3 months ago)
by
gvanrossum
File length: 27270 byte(s)
Diff to
previous 34726
Stop GCC warning about int literal that's so long that it becomes an
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).
Revision
34726 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Nov 24 02:57:33 2003 UTC
(13 years, 3 months ago)
by
rhettinger
File length: 27269 byte(s)
Diff to
previous 34722
* Checkin remaining documentation
* 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).
Revision
34722 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Nov 23 02:49:05 2003 UTC
(13 years, 3 months ago)
by
rhettinger
File length: 26805 byte(s)
Diff to
previous 34720
* Simplify hash function and add test to show effectiveness of the hash
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.
Revision
34711 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Nov 20 22:54:33 2003 UTC
(13 years, 3 months ago)
by
rhettinger
File length: 25156 byte(s)
Diff to
previous 34652
Three minor performance improvements:
* 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.
Revision
34647 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Added
Sun Nov 16 16:17:49 2003 UTC
(13 years, 3 months ago)
by
rhettinger
File length: 24245 byte(s)
* Migrate set() and frozenset() from the sandbox.
* 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 form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
enter a numeric revision.