| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
checkin. :-(
|
|
|
|
|
| |
the thread started at
http://mail.python.org/pipermail/python-dev/2003-April/034338.html
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
mwh pointed out that the error message did not
make sense if obtained by rearranging the bases.
|
|
|
|
|
| |
generalize to take a callback function and a void * data argument.
This might come in handy later... :-)
|
|
|
|
|
|
|
|
|
|
|
| |
Arranged that all the objects exposed by __builtin__ appear in the list
of all objects. I basically peed away two days tracking down a mystery
leak in sys.gettotalrefcount() in a ZODB app (== tons of code), because
the object leaking the references didn't appear in the sys.getobjects(0)
list. The object happened to be False. Now False is in the list, along
with other popular & previously missing leak candidates (like None).
Alas, we still don't have a choke point covering *all* Python objects,
so the list of all objects may still be incomplete.
|
|
|
|
|
|
| |
__contains__().
Bugfix candidate.
|
|
|
|
|
|
|
| |
_Py_AddToAllObjects() that simply inserts an object at the front of
the doubly-linked list of all objects. Changed PyType_Ready() (the
closest thing we've got to a choke point for type objects) to call
that.
|
|
|
|
| |
Clarify error message for mro conflicts.
|
|
|
|
|
| |
classes defined by Python code using a class statement) is now
exported from object.h as PyHeapTypeObject. (SF patch #696193.)
|
|
|
|
|
|
|
| |
This still falls back to helpers in copy_reg for:
- pickle protocols < 2
- calculating the list of slot names (done only once per class)
- the __newobj__ function (which is used as a token but never called)
|
|
|
|
|
| |
if it exists in preference over __reduce__. Now Tim can go implement this
in cPickle.c.
|
| |
|
|
|
|
|
|
|
|
| |
using super() for an instance in a metaclass situation. Because the
class was a metaclass, the instance was a class, and hence the
PyType_Check() branch was taken. But this branch didn't apply. Make
it so that if this branch doesn't apply, the other branch is still
tried. All tests pass.
|
|
|
|
|
|
|
| |
This changes the default __new__ to refuse arguments iff tp_init is the
default __init__ implementation -- thus making it a TypeError when you
try to pass arguments to a constructor if the class doesn't override at
least __init__ or __new__.
|
|
|
|
| |
now be a proxy for an X instance, as long as issubclass(x.__class__, X).
|
|
|
|
| |
types -- Python types already inherited this.
|
|
|
|
|
| |
now, it was only called once, and its existence merely obfuscates the
control flow.
|
|
|
|
|
|
|
| |
when Python code calls a descriptor's __get__ method. It should
translate None to NULL in both argument positions, and insist that at
least one of the argument positions is not NULL after this
transformation.
|
|
|
|
|
|
| |
was used. This simplifies some logic in copy_reg.py (used by
pickling). It also broke a test, but this was rewritten to test the
new feature. :-)
|
| |
|
|
|
|
| |
the code.
|
|
|
|
|
| |
__weaklist__ descriptor if we added __dict__ or __weaklist__,
respectively. With unit test.
|
|
|
|
|
| |
SF bug #623669: only try (e.g.) __rdiv__ before __div__ if the right
class actually overrides it.
|
|
|
|
|
|
|
| |
645404). I'm not 100% sure this is the right fix, so I'll keep the
bug report open for Samuele, but this fixes the index error and passes
the test suite (and I can't see why it *shouldn't* be the right fix
:-).
|
| |
|
| |
|
|
|
|
|
|
|
| |
Most of these patches are from Thomas Heller, with long lines folded
by Tim. The change to test_descr.py is from Guido. See the bug report.
Not a bugfix candidate -- METH_CLASS is new in 2.3.
|
|
|
|
|
|
|
| |
tests. I found the logic too confusing to follow here, so rewrote more
than was likely absolutely necessary.
Bugfix candidate.
|
|
|
|
|
|
| |
integer hash object returned by __hash__(). This accounts for some of
the "mystery leaks" in the sandbox datetime tests, but probably not
all of them.
|
|
|
|
|
|
|
| |
the results of *setting* __name__ are not so surprising.
If people can suggest more tests, that'd be grand, or is what's there
sufficient?
|
|
|
|
|
|
|
| |
see problems with my code that I didn't see before the checkin, but:
When a subtype .mro() fails, we need to reset the type whose __bases__
are being changed, too. Fix + test.
|
|
|
|
|
|
| |
mro() methods. Now any exception aborts the whole __bases__ change.
And more tests.
|
| |
|
|
|
|
| |
It's odd that gcc on my ibook didn't complain about this.
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ 635933 ] make some type attrs writable
Plus a couple of extra tests beyond what's up there.
It hasn't been as carefully reviewed as it perhaps should, so all readers
are encouraged, nay exhorted, to give this a close reading.
There are still a couple of oddities related to assigning to __name__,
but I intend to solicit python-dev's opinions on these.
|
|
|
|
|
|
| |
messages about MRO conflicts. (The tweaks include correcting spelling
errors, some refactoring to get the name of classic classes, and a
style nit or two.)
|
|
|
|
| |
treats as a fatal error).
|
|
|
|
|
|
|
|
|
|
| |
619475; also closing SF bug 618704). I tweaked his code a bit for
style.
This raises TypeError for MRO order disagreements, which is an
improvement (previously these went undetected) but also a degradation:
what if the order disagreement doesn't affect any method lookups?
I don't think I care.
|
|
|
|
| |
Don't crash when getting value of a property raises an exception
|
|
|
|
| |
running tests. Withdraw 2.183 and its backport.
|
|
|
|
| |
Will backport.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
classes was called with three arguments. This makes no sense, there's
no way to pass in the "modulo" 3rd argument as for __pow__, and
classic classes don't do this. [SF bug 620179]
I don't want to backport this to 2.2.2, because it could break
existing code that has developed a work-around. Code in 2.2.2 that
wants to use __ipow__ and wants to be forward compatible with 2.3
should be written like this:
def __ipow__(self, exponent, modulo=None):
...
|
| |
|
| |
|