| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
containing class objects) are allowed as the second argument.
This makes issubclass() more similar to isinstance() where recursive
tuples are allowed too.
|
|
|
|
|
|
|
|
|
|
|
| |
supported as the second argument. This has the same meaning as
for isinstance(), i.e. issubclass(X, (A, B)) is equivalent
to issubclass(X, A) or issubclass(X, B). Compared to isinstance(),
this patch does not search the tuple recursively for classes, i.e.
any entry in the tuple that is not a class, will result in a
TypeError.
This closes SF patch #649608.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Added related testcase.
Closes SF bug #643260.
|
|
|
|
| |
Simplifies the code and gets Just van Rossum's example to work.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
[ 633152 ] list slice ass ignores subtypes of list
Allow arbitrary sequences on the RHS of extended slices.
|
|
|
|
|
|
|
| |
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.
|