[Python-checkins] python/nondist/sandbox/setobj setobject.c, 1.12,
1.13 test_set.py, 1.12, 1.13
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Fri Nov 14 17:59:30 EST 2003
Update of /cvsroot/python/python/nondist/sandbox/setobj
In directory sc8-pr-cvs1:/tmp/cvs-serv4733
Modified Files:
setobject.c test_set.py
Log Message:
Make sets and frozensets interoperable.
Index: setobject.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setobj/setobject.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** setobject.c 14 Nov 2003 22:07:13 -0000 1.12
--- setobject.c 14 Nov 2003 22:59:27 -0000 1.13
***************
*** 870,874 ****
0, /* tp_setattro */
0, /* tp_as_buffer */
! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
Py_TPFLAGS_BASETYPE, /* tp_flags */
set_doc, /* tp_doc */
--- 870,874 ----
0, /* tp_setattro */
0, /* tp_as_buffer */
! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_CHECKTYPES |
Py_TPFLAGS_BASETYPE, /* tp_flags */
set_doc, /* tp_doc */
***************
*** 965,969 ****
0, /* tp_setattro */
0, /* tp_as_buffer */
! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
Py_TPFLAGS_BASETYPE, /* tp_flags */
frozenset_doc, /* tp_doc */
--- 965,969 ----
0, /* tp_setattro */
0, /* tp_as_buffer */
! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_CHECKTYPES |
Py_TPFLAGS_BASETYPE, /* tp_flags */
frozenset_doc, /* tp_doc */
Index: test_set.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setobj/test_set.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** test_set.py 14 Nov 2003 22:07:13 -0000 1.12
--- test_set.py 14 Nov 2003 22:59:28 -0000 1.13
***************
*** 34,38 ****
def test_or(self):
i = self.s.union(self.otherword)
! self.assertEqual(self.s | self.thetype(self.otherword), i)
try:
self.s | self.otherword
--- 34,39 ----
def test_or(self):
i = self.s.union(self.otherword)
! self.assertEqual(self.s | set(self.otherword), i)
! self.assertEqual(self.s | frozenset(self.otherword), i)
try:
self.s | self.otherword
***************
*** 50,54 ****
def test_and(self):
i = self.s.intersection(self.otherword)
! self.assertEqual(self.s & self.thetype(self.otherword), i)
try:
self.s & self.otherword
--- 51,56 ----
def test_and(self):
i = self.s.intersection(self.otherword)
! self.assertEqual(self.s & set(self.otherword), i)
! self.assertEqual(self.s & frozenset(self.otherword), i)
try:
self.s & self.otherword
***************
*** 66,70 ****
def test_sub(self):
i = self.s.difference(self.otherword)
! self.assertEqual(self.s - self.thetype(self.otherword), i)
try:
self.s - self.otherword
--- 68,73 ----
def test_sub(self):
i = self.s.difference(self.otherword)
! self.assertEqual(self.s - set(self.otherword), i)
! self.assertEqual(self.s - frozenset(self.otherword), i)
try:
self.s - self.otherword
***************
*** 82,86 ****
def test_xor(self):
i = self.s.symmetric_difference(self.otherword)
! self.assertEqual(self.s ^ self.thetype(self.otherword), i)
try:
self.s ^ self.otherword
--- 85,90 ----
def test_xor(self):
i = self.s.symmetric_difference(self.otherword)
! self.assertEqual(self.s ^ set(self.otherword), i)
! self.assertEqual(self.s ^ frozenset(self.otherword), i)
try:
self.s ^ self.otherword
More information about the Python-checkins
mailing list