Raymond Hettinger
5307bc50ea
Backport fix to SF bug #820397 : __nonzero__() returns 1/0
2003-10-12 23:41:21 +00:00
Raymond Hettinger
6b560bc648
SF patch #820195 : make object.__contains__() returns True or False instead
...
of 1 or 0.
Backport Guido's fix to the default __contains__() and to proxy_has_key()
so they will properly return booleans instead of integers.
2003-10-09 20:51:07 +00:00
Michael W. Hudson
40b4a6b015
As penance for forgetting to flag my last checkins as bugfix candidates,
...
just do the backport.
These changes do not apply to release22-maint.
2003-08-07 15:08:55 +00:00
Jeremy Hylton
f75d9fce16
Remove stray comments.
2003-07-16 16:17:57 +00:00
Jeremy Hylton
1c7a0ea056
Remove unnecessary check in tests for slots allowed.
...
The !PyType_Check(base) check snuck in as part of rev 2.215, but was
unrelated to the SF patch that is mentioned in the checkin comment.
The test is currently unnecessary because base is set to the return
value of best_bases(), which returns a type or NULL.
2003-07-16 16:08:23 +00:00
Jeremy Hylton
3e3159ce6a
Require that __nonzero__() return a bool or exactly an int.
2003-06-27 17:38:27 +00:00
Jeremy Hylton
090a3495b3
Check return type of __nonzero__() method.
...
The language reference says you must return an int or a bool. This
fix limits the scope of SF bug 759227 (infinite recursion) to
subclasses of int.
2003-06-27 16:46:45 +00:00
Guido van Rossum
59195fdf40
- SF patch 751998 fixes an unwanted side effect of the previous fix
...
for SF bug 742860 (the next item).
2003-06-13 20:54:40 +00:00
Brett Cannon
10147f7d13
Fixed a comment.
2003-06-11 20:50:33 +00:00
Neal Norwitz
e2fdc61004
Fix SF #749831 , copy raises SystemError when getstate raises exception
2003-06-08 13:19:58 +00:00
Guido van Rossum
1987c6693b
Fix for SF 742911. We now clear the weakrefs *before* calling __del__
...
or emptying __dict__, just as we do for classic classes.
2003-05-29 14:29:23 +00:00
Tim Peters
3cfe75470d
PyType_Ready(): Complain if the type is a base type, and gc'able, and
...
tp_free is NULL or PyObject_Del at the end. Because it's a base type
it must call tp_free in its dealloc function, and because it's gc'able
it must not call PyObject_Del.
inherit_slots(): Don't inherit tp_free unless the type and its base
agree about whether they're gc'able. If the type is gc'able and the
base is not, and the base uses the default PyObject_Del for its
tp_free, give the type PyObject_GC_Del for its tp_free (the appropriate
default for a gc'able type).
cPickle.c: The Pickler and Unpickler types claim to be base classes
and gc'able, but their dealloc functions didn't call tp_free.
Repaired that. Also call PyType_Ready() on these typeobjects, so
that the correct (PyObject_GC_Del) default memory-freeing function
gets plugged into these types' tp_free slots.
2003-05-21 21:29:48 +00:00
Brett Cannon
be67d87e4d
Fixing the previous patch to have the changes be to the proper docstrings.
2003-05-20 02:40:12 +00:00
Brett Cannon
154da9b7e2
Fix docstrings for __(get|set|del)slice__ to mention that negative indices are not supported.
2003-05-20 02:30:04 +00:00
Martin v. Löwis
a94568a753
Patch #734231 : Update RiscOS support. In particular, correct
...
riscospath.extsep, and use os.extsep throughout.
2003-05-10 07:36:56 +00:00
Guido van Rossum
636688d470
Improve the message about metatype/metaclass conflicts.
2003-04-23 12:07:22 +00:00
Guido van Rossum
6cc5bb685d
Sigh. The crucial change was still missing from the previous
...
checkin. :-(
2003-04-16 20:01:36 +00:00
Guido van Rossum
76ba09fd81
- super() no longer ignores data descriptors, except __class__. See
...
the thread started at
http://mail.python.org/pipermail/python-dev/2003-April/034338.html
2003-04-16 19:40:58 +00:00
Guido van Rossum
19a02ba69d
Fix three (!) object leaks in the code for assignment to __bases__.
2003-04-15 22:09:45 +00:00
Guido van Rossum
52b2705e9c
Ouch, it's Carlo Verre, not Verre Carlo.
2003-04-15 20:05:10 +00:00
Guido van Rossum
4dcdb78c6f
Close off the "Verre Carlo hack" as discussed on python-dev.
2003-04-14 21:46:03 +00:00
Guido van Rossum
2fd02eb80f
super_getattro(): kill some dead code; explain a mystery.
2003-04-14 21:20:26 +00:00
Jeremy Hylton
d06483c2f6
Missing DECREF.
2003-04-09 21:01:42 +00:00
Raymond Hettinger
f394df47fd
SF bug #699934 : Obscure error message
...
mwh pointed out that the error message did not
make sense if obtained by rearranging the bases.
2003-04-06 19:13:41 +00:00
Guido van Rossum
8d24ee97df
Refactoring: rename update_these_slots() into update_subclasses() and
...
generalize to take a callback function and a void * data argument.
This might come in handy later... :-)
2003-03-24 23:49:49 +00:00