| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Just van Rossum showed a weird, but clever way for pure python code to
trigger the BadInternalCall. The C code had assumed that calling a class
constructor would return an instance of that class; however, classes that
abuse __new__ can invalidate that assumption.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
method for constructing new dictionaries from sequences of keys.
|
|
|
|
| |
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.)
|
| |
|
| |
|
|
|
|
| |
dereference rather than the caller.
|
|
|
|
| |
both have a nb_remainer slot.
|
|
|
|
|
|
|
| |
dict() constructor. Example:
>>> dict(a=1, b=2)
{'a': 1, 'b': 2}
>>>
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
long but the double is too big to fit in a long. Prevent that. This
closes some recent bug or patch on SF, but SF is down now so I can't
say which.
Bugfix candidate.
|
|
|
|
|
|
|
| |
that is outside the integer range no longer raises OverflowError, but
returns a long object instead.
This fixes SF bug http://www.python.org/sf/635115
|
| |
|
| |
|
|
|
|
| |
have a nb_float slot. This matches what PyInt_AsLong does.
|
|
|
|
|
| |
PyNumber_Remainder(). This fixes SF bug #615506 and allows string and unicode
subclasses to override __mod__.
|
|
|
|
|
|
| |
Py_Init crash". refchain cannot be cleared because objects can live across
Py_Finalize() and Py_Initialize() if they are kept alive by circular
references.
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
When mwh added extended slicing, strings and unicode became mappings.
Thus, dict was set which prevented an error when doing:
newstr = 'format without a percent' % string_value
This fix raises an exception again when there are no formats
and % with a string value.
|
|
|
|
|
|
|
|
|
|
|
| |
Armin Rigo's Draconian but effective fix for
SF bug 453523: list.sort crasher
slightly fiddled to catch more cases of list mutation. The dreaded
internal "immutable list type" is gone! OTOH, if you look at a list
*while* it's being sorted now, it will appear to be empty. Better
than a core dump.
|
|
|
|
|
| |
dir(xrange(10))
xrange(10).__getitem__(4)
|
|
|
|
|
|
| |
Also remove the 512 character limitation for int(u"...") and long(u"...").
This closes SF bug #629989.
|
|
|
|
| |
Fixes a test failure on 64 bit platforms (I hope).
|
| |
|
|
|
|
| |
PySequence_Fast needs to do anything siginificant.
|
|
|
|
|
|
| |
[ 633870 ] allow any seq assignment to a list slice
plus a very silly little test case of my own.
|
|
|
|
|
|
|
|
|
|
|
|
| |
/* this is harder to get right than you might think */
angered some God somewhere. After noticing
>>> range(5000000)[slice(96360, None, 439)]
[]
I found that my cute test for the slice being empty failed due to
overflow. Fixed, and added simple test (not the above!).
|
|
|
|
|
|
|
| |
instance_getattr2() raises an exception. Fix all code that made this
assumption.
Backport candidate.
|
|
|
|
| |
larger than the system page size.
|
|
|
|
| |
Python 2.2.3 candidate.
|
| |
|
|
|
|
| |
Don't crash when getting value of a property raises an exception
|
| |
|
|
|
|
| |
Perhaps found by NealN and valgrind. Will forward port.
|
|
|
|
| |
running tests. Withdraw 2.183 and its backport.
|
|
|
|
| |
Will backport.
|
| |
|
|
|
|
| |
Use integers in stat tuple, optionally floats in named fields.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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):
...
|
| |
|
| |
|
| |
|