| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
and unicode
Patch by Christopher Blunck.
|
|
|
|
|
|
|
| |
Fix infinite recursion which occurred when printing an object
whose __str__() returned self.
Will backport
|
|
|
|
|
| |
is treated as "character maps to <undefined>" and not as
"character mapping must return integer, None or str".
|
|
|
|
| |
(except for Py_DECREF calls) since the introduction of __unicode__.
|
|
|
|
|
| |
__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.
|
|
|
|
|
| |
a single character. Shaves another 10% off the running time by avoiding
the lg2(N) loops and cache effects for the other cases.
|
|
|
|
|
|
|
|
|
|
|
| |
Christian Tismer pointed out the high cost of the loop overhead and
function call overhead for 'c' * n where n is large. Accordingly,
the new code only makes lg2(n) loops.
Interestingly, 'c' * 1000 * 1000 ran a bit faster with old code. At some
point, the loop and function call overhead became cheaper than invalidating
the cache with lengthy memcpys. But for more typical sizes of n, the new
code runs much faster and for larger values of n it runs only a bit slower.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refactor code in PyCFunction_Call giving a modest (tiny) speed boost,
a slight improvement in semantics (now detects invalid flag combinations),
and (arguably) improved clarity (making it blindingly clear which flag
combinations are allowed). All this comes at a cost of a few lines of
code duplication.
* Folded test for METH_KEYWORDS into the switch/case.
* Deferred testing for an empty dictionary until when and where needed.
* Make a similar deferral for filling the "size" variable.
* Inverted the dictionary test so that the common case falls though
instead of making a jump.
|
| |
|
| |
|
|
|
|
| |
661092.
|
|
|
|
| |
Plug the leak that Tim just reported.
|
|
|
|
|
|
|
| |
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
:-).
|
| |
|
|
|
|
|
|
| |
Initialize the small integers and __builtins__ in startup.
This removes some if conditions.
Change XDECREF to DECREF for values which shouldn't be NULL.
|
|
|
|
| |
integers checked for integer overflow but longs did not.
|
|
|
|
|
|
|
| |
andsq_inplace_repeat. This fixes a number of corner case bugs (see #624807).
Consolidate the int and long sequence repeat code. Before the change, integers
checked for integer overflow but longs did not.
|
|
|
|
|
| |
Python 2.2.x backport candidate. (This bug has been around since
Python 1.6.)
|
|
|
|
|
|
|
| |
Obtain cleaner coding and a system wide
performance boost by using the fast, pre-parsed
PyArg_Unpack function instead of PyArg_ParseTuple
function which is driven by a format string.
|
|
|
|
| |
experimental.
|
|
|
|
|
|
| |
blockstack_top could be 0 when blockstack[blockstack_top-1]
was referenced (ie blockstack[-1]) which crashed on hpux.
Patch & fix by Richie Hindle
|
|
|
|
| |
Some systems (HPUX at least) already define MIN/MAX for us
|
|
|
|
|
|
|
| |
Check return values after memory allocation.
Also use Py_True instead of PyInt_FromLong(1) for bool value.
Backport candidate.
|
|
|
|
|
| |
(file_read): Replaced assertion with mixed sign operation by a simple
comment (thank you Raymond). The algorithm is clear enough in that point.
|
|
|
|
|
|
|
|
| |
[ 643835 ] Set Next Statement for Python debuggers
with a few tweaks by me: adding an unsigned or two, mentioning that
not all jumps are allowed in the doc for pdb, adding a NEWS item and
a note to whatsnew, and AuCTeX doing something cosmetic to libpdb.tex.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[#521782] unreliable file.read() error handling
* Objects/fileobject.c
(file_read): Clear errors before leaving the loop in all situations,
and also check if some data was read before exiting the loop with an
EWOULDBLOCK exception.
* Doc/lib/libstdtypes.tex
* Objects/fileobject.c
Document that sometimes a read() operation can return less data than
what the user asked, if running in non-blocking mode.
* Misc/NEWS
Document the fix.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|