Raymond Hettinger
a37430a0ce
dict.copy() rises from the ashes. Revert r60687.
2008-02-12 19:05:36 +00:00
Raymond Hettinger
17a74c395e
Add -3 warnings that set.copy(), dict.copy(), and defaultdict.copy() will go away in Py3.x
2008-02-09 04:37:49 +00:00
Christian Heimes
5b970ad483
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.
2008-02-06 13:33:44 +00:00
Amaury Forgeot d'Arc
cab3d98ca1
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.
2008-02-03 22:51:43 +00:00
Raymond Hettinger
7759a0cd76
Factor-out common code with a new macro
2008-01-28 21:47:42 +00:00
Raymond Hettinger
ecdcb58950
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.
2008-01-28 20:34:33 +00:00
Raymond Hettinger
dee3f65d98
Revert PySet_Add() changes.
2008-01-26 09:31:11 +00:00
Raymond Hettinger
d375723365
Update test code for change to PySet_Add().
2008-01-26 08:41:13 +00:00
Raymond Hettinger
7c1be2a3b1
Make PySet_Add() work with frozensets. Works like PyTuple_SetItem() to build-up values in a brand new frozenset.
2008-01-26 08:19:06 +00:00
Raymond Hettinger
3dbd4c536d
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.
2008-01-25 19:24:46 +00:00
Christian Heimes
e93237dfcc
#1629 : Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT. Macros for b/w compatibility are available.
2007-12-19 02:37:44 +00:00
Guido van Rossum
64c06e327d
Backport of _abccoll.py by Benjamin Arangueren, issue 1383.
...
With some changes of my own thrown in (e.g. backport of r58107).
2007-11-22 00:55:51 +00:00
Raymond Hettinger
e8d58ba6bb
Reposition the decref (spotted by eagle-eye norwitz).
2007-11-08 18:47:51 +00:00
Raymond Hettinger
1760c8a017
Add set.isdisjoint()
2007-11-08 02:52:43 +00:00
Brett Cannon
0153159e67
Add a bunch of GIL release/acquire points in tp_print implementations and for
...
PyObject_Print().
Closes issue #1164 .
2007-09-17 03:28:34 +00:00
Martin v. Löwis
6819210b9e
PEP 3123: Provide forward compatibility with Python 3.0, while keeping
...
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
2007-07-21 06:55:02 +00:00
Guido van Rossum
360496d9c0
Fix a bug in test_c_api() that caused a negative refcount.
2007-05-10 17:20:15 +00:00
Raymond Hettinger
0bbbfc4c0b
Extend work on rev 52962 and 53829 eliminating redundant PyObject_Hash() calls and fixing set/dict interoperability.
2007-03-20 21:27:24 +00:00
Raymond Hettinger
15cade0568
Fixup set/dict interoperability.
2007-02-19 20:44:04 +00:00
Raymond Hettinger
d6fc72a5ae
Extend work on revision 52962: Eliminate redundant calls to PyObject_Hash().
2007-02-19 02:03:19 +00:00
Raymond Hettinger
0e7a632f57
Bypass set specific optimizations for set and frozenset subclasses.
2007-02-08 00:50:39 +00:00
Raymond Hettinger
db67aef672
Bug #1648179 : set.update() not recognizing __iter__ overrides in dict subclasses.
2007-02-01 21:02:59 +00:00
Raymond Hettinger
9fdfadb06e
SF #1486663 -- Allow keyword args in subclasses of set() and frozenset().
2007-01-11 18:22:55 +00:00
Raymond Hettinger
5399910eba
For sets with cyclical reprs, emit an ellipsis instead of infinitely recursing.
2006-12-30 04:01:17 +00:00
Raymond Hettinger
9c14ffbc78
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).
2006-12-08 04:57:50 +00:00
Raymond Hettinger
0c850863a2
Port Armin's fix for a dict resize vulnerability (svn revision 46589, sf bug 1456209).
2006-12-08 04:24:33 +00:00
Raymond Hettinger
f31e17509a
Eliminate two redundant calls to PyObject_Hash().
2006-12-08 03:17:18 +00:00
Neal Norwitz
a5ccda95f2
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.
2006-10-28 21:16:54 +00:00
Raymond Hettinger
c563a1c32b
Fix refcounts and add error checks.
2006-09-07 02:42:48 +00:00
Andrew M. Kuchling
52740be425
[Bug #1414697 ] Change docstring of set/frozenset types to specify that the contents are unique. Raymond, please feel free to edit or revert.
2006-07-29 15:10:32 +00:00
Neal Norwitz
04e39ec815
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 .
2006-07-17 00:57:15 +00:00
Neal Norwitz
0f2783cb4c
Use Py_ssize_t
2006-06-19 05:40:44 +00:00
Martin v. Löwis
ed8f783126
Clear dummy and emptyfrozenset, so that we don't have
...
dangling references in case of a Py_Initialize/Py_Finalize
cycle.
2006-04-15 12:47:23 +00:00
Armin Rigo
e170937af6
Ignore the references to the dummy objects used as deleted keys
...
in dicts and sets when computing the total number of references.
2006-04-12 17:06:05 +00:00
Martin v. Löwis
72d206776d
Remove "static forward" declaration. Move constructors
...
after the type objects.
2006-04-11 09:04:12 +00:00
Barry Warsaw
176014ffad
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.
2006-03-30 22:45:35 +00:00
Georg Brandl
347b30042b
Remove unnecessary casts in type object initializers.
2006-03-30 11:57:00 +00:00
Raymond Hettinger
334b5b20f2
Tighten an overbroad and misleading assertion.
...
(Reported by Jim Jewett.)
2006-03-26 03:11:29 +00:00
Neal Norwitz
8c49c82889
Use Py_ssize_t for PySet_Size() like all the other Py*_Size() functions.
2006-03-04 18:41:19 +00:00
Martin v. Löwis
18e165558b
Merge ssize_t branch.
2006-02-15 17:27:45 +00:00
Armin Rigo
f5b3e36493
Renamed _length_cue() to __length_hint__(). See:
...
http://mail.python.org/pipermail/python-dev/2006-February/060524.html
2006-02-11 21:32:43 +00:00
Neal Norwitz
0c6e2f1640
Remove some shadowed variables
2006-01-08 06:13:44 +00:00
Neal Norwitz
6576bd844f
Prevent name pollution by making lots of internal functions static.
2005-11-13 18:41:28 +00:00
Raymond Hettinger
6b27cda643
Convert iterator __len__() methods to a private API.
2005-09-24 21:23:05 +00:00
Raymond Hettinger
9bda1d6f64
No longer ignore exceptions raised by comparisons during key lookup.
...
Inspired by Armin Rigo's suggestion to do the same with dictionaries.
2005-09-16 07:14:21 +00:00
Georg Brandl
02c42871cf
Disallow keyword arguments for type constructors that don't use them.
...
(fixes bug #1119418 )
2005-08-26 06:42:30 +00:00
Raymond Hettinger
9c1491f37c
* Add a fast equality check path for frozensets where the hash value has
...
already been computed.
* Apply a GET_SIZE macro().
2005-08-24 00:24:40 +00:00
Raymond Hettinger
d8e133865d
Add shortcuts for a|a and a&a.
2005-08-17 12:27:17 +00:00
Raymond Hettinger
f408ddf4a0
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.
2005-08-17 00:27:42 +00:00
Raymond Hettinger
c47e01d020
Numerous fix-ups to C API and docs. Added tests for C API.
2005-08-16 10:44:15 +00:00