| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
as discussed on IRC. The equivalent tests for the new behavior are in
test_builtin.py.
|
| |
|
|
|
|
| |
From SF patch #852334.
|
| |
|
|
|
|
|
|
|
|
|
| |
[ 784825 ] fix obscure crash in descriptor handling
Should be applied to release23-maint and in all likelyhood
release22-maint, too.
Certainly doesn't apply to release21-maint.
|
|
|
|
| |
Include a test case that failed for one of my efforts to repair this.
|
|
|
|
| |
* Added unittest that fails before, but not after Neil's fix to ceval.c.
|
|
|
|
|
|
| |
Check the argument to classmethod for callability.
Backport candidate.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
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.
|
|
|
|
| |
Clarify error message for mro conflicts.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
| |
instance, as long as x.__class__ is X or a subclass thereof.
Did a little cleanup of PyObject_IsInstance() too.
|
|
|
|
|
|
| |
descr_check(); it wasn't useful. Change the type argument of the
various _get() methods to PyObject * because the call signature of
tp_descr_get doesn't guarantee its type.
|
|
|
|
|
|
| |
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. :-)
|
|
|
|
|
|
| |
When subclassing from an int but not overriding __new__,
long values were not converted properly. Try to convert
longs into an int.
|
|
|
|
| |
(Yes, this is an incompatibility. I'll document it in PEP 307.)
|
|
|
|
|
|
|
| |
Fix infinite recursion which occurred when printing an object
whose __str__() returned self.
Will backport
|
|
|
|
|
| |
__weaklist__ descriptor if we added __dict__ or __weaklist__,
respectively. With unit test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- SLOT1BINFULL() macro: changed this to check for __rop__ overriding
__op__, like binary_op1() in abstract.c -- the latter only calls the
slot function once if both types use the same slot function, so the
slot function must make both calls -- which it already did for the
__op__, __rop__ order, but not yet for the __rop__, __op__ order
when B.__class__ is a subclass of A.__class__.
Also test the refinement added in rev. 2.201 that fixes the problem
reported in SF bug #623669.
Also test a similar provision in abstract.c's binary_op1().
|
|
|
|
|
| |
tests are run. (All tests in this module should have one of these at
the top.)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Avoid depending on this in the test.
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ 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. (Tweaks here: don't print the message,
but compare it with an expected string.)
|
| |
|
|
|
|
|
|
|
| |
dict() constructor. Example:
>>> dict(a=1, b=2)
{'a': 1, 'b': 2}
>>>
|
|
|
|
| |
algorithm, and add some new tests for the C3 algorithm.
|
|
|
|
| |
Don't crash when getting value of a property raises an exception
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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):
...
|
|
|
|
|
| |
the string/unicode method .replace() with a zero-lengt first argument.
Inyeol contributed tests for this too.
|
|
|
|
| |
Add some more rigor to slotmultipleinheritance().
|
|
|
|
| |
Fix already checked in by Guido
|