| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
last patch. Dave Ascher found a case that dumps core without these:
def myComparison(x,y):
return cmp(x%3,y%7)
z = range(12)
z.sort(myComparison)
|
|
|
|
|
|
|
|
|
| |
clear_carefully() used to do in import.c. Differences: leave only
__builtins__ alone in the 2nd pass; and don't clear the dictionary (on
the theory that as long as there are references left to the
dictionary, those might be destructors that might expect __builtins__
to be alive when they run; and __builtins__ can't normally be part of
a cycle).
|
|
|
|
|
|
|
| |
if the globals are the same.
Also, when creating a dummy builtins dictionary, add "None" to it,
just to be kind.
|
| |
|
|
|
|
| |
contains the type of the object and name of the attribute.
|
|
|
|
|
| |
quicksort. This should be much faster if there are lots of
duplicates, and otherwise at least as good.
|
|
|
|
|
| |
like <modulename.classname instance at ...> (to match the repr() of
class objects.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyNumber_Coerce() except that when the coercion can't be done and no
other exceptions happen, it returns 1 instead of raising an
exception.
Use this function in PyObject_Compare() to avoid raising an exception
simply because two objects with numeric behavior can't be coerced to a
common type; instead, proceed with the non-numeric default comparison.
Note that this is a somewhat questionable practice -- comparisons for
numeric objects shouldn't default to random behavior like this, but it
is required for backward compatibility. (Case in point, it broke
comparison of kjDict objects to integers in Aaron Watters' kjbuckets
extension.) A correct fix (for python 2.0) should involve a different
definiton of comparison altogether.
|
|
|
|
|
| |
variables called 'coerce' were accidentally renamed to
'PyNumber_Coerce'. Rename them back to coercefunc.
|
|
|
|
|
|
|
| |
sys.stdin.readline(), you get a fatal error (no current thread). This
is because there was a call to PyErr_CheckSignals() while there was no
current thread. I wonder how many more of these we find... I bnetter
go hunting for PyErr_CheckSignals() now...
|
| |
|
|
|
|
|
|
| |
in libmath.a so they are available to mathmodule.so (in case it is
shared). While this still gets triggered on Solaris 2.x, this appears
to be harmless there.
|
|
|
|
| |
PyCObject_GetDesc().
|
|
|
|
| |
"modulename.classname" instead of returning the same as repr().
|
| |
|
|
|
|
| |
Also got rid of some unnecessary code.
|
|
|
|
| |
expecting the caller to do so.
|
|
|
|
|
|
|
|
|
| |
__getitem__(). This method never raises an exception; if the key is
not in the dictionary, the second (optional) argument is returned. If
the second argument is not provided and the key is missing, None is
returned.
mapp_methods: added "get" method.
|
| |
|
|
|
|
|
| |
whose name is in the current globals' __name__ variable. If __name__
is not set, ignore this.
|
|
|
|
|
|
| |
arbitrary nested parens in a %(...)X style format.
#Also folded two lines and added more detail to the error message for
#unsupported format character.
|
|
|
|
|
|
|
|
|
|
|
|
| |
former lets you give an instance a set of new instance vars. The
latter lets you give it a new class. Both are typechecked and
disallowed in restricted mode.
For classes, the check for read-only special attributes is tightened
so that only assignments to __dict__, __bases__, __name__,
__getattr__, __setattr__, and __delattr__ (these could be made to work
as well, but I don't know if that's useful -- let's see first whether
mucking with instances will help).
|
|
|
|
|
| |
sys/types.h header on many systems that may get pulled in (through
WANT_SIGFPE_HANDLER which pulls in signal.h).
|
| |
|
|
|
|
| |
improvement of pystone. Vladimir Marangozov.
|
| |
|
| |
|
|
|
|
|
|
| |
SystemError: bad argument to internal function
caused by comparing NULL pointer default args.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
from the interned table. There are references in hard-to-find static
variables all over the interpreter, and it's not worth trying to get
rid of all those; but "uninterning" isn't fair either and may cause
subtle failures later -- so we have to keep them in the interned
table.
Also get rid of no-longer-needed insert of None in interned dict.
|
|
|
|
| |
few percent speed up. Also add PyCFunction_Fini() to discard it.
|
|
|
|
|
|
|
| |
no valid directory is passed in. This prevents __del__ to fail when
invoked after __builtins__ has already been discarded.
Also add PyFrame_Fini() to discard the cache of frames.
|
|
|
|
| |
percent speed up. Also add PyMethod_Fini() to discard it.
|
|
|
|
|
|
|
| |
In _Py_PrintReferences(), no longer suppress once-referenced string.
Add Py_Malloc and friends and PyMem_Malloc and friends (malloc
wrappers for third parties).
|
|
|
|
|
| |
-- the thread state is passed in as an argument and the builtins are a
member thereof.
|
|
|
|
| |
strings. For use in Py_Finalize() only.
|
| |
|
|
|
|
| |
ones near the front.
|
|
|
|
|
|
| |
ones near the front.
Also added a missing "return -1" to PyFile_WriteString.
|
|
|
|
| |
This should solve a weird problem on the Mac for Jack.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
few places where we don't know how to test for them without losing
speed; don't know yet how to handle that.
|
|
|
|
| |
PyErr_Clear().
|
| |
|
|
|
|
| |
in methodobject.h) to 'func'. /bin/cc on SunOS 4.x didn't grok this.
|
|
|
|
| |
Fixed two 'return NULL' that should be 'return -1'.
|
| |
|