Guido van Rossum
91aaa92c88
Ugly band-aid to work around a bug in Linux ftell().
1998-05-05 22:21:35 +00:00
Guido van Rossum
e32907df67
Get rid of the unused ifdefed-out old sort code.
1998-04-28 17:54:03 +00:00
Guido van Rossum
9b00dfae75
If USE_STACKCHECK is defined use PyOS_CheckStack() in the repr and str
...
routines. This catches a slightly different set of crashes than the
recursive-repr fix.
(Jack)
1998-04-28 16:06:54 +00:00
Guido van Rossum
f2044e1a71
Enable ftruncate() on the Mac.
...
(Jack)
1998-04-28 16:05:59 +00:00
Guido van Rossum
82e6a8f80d
Quicksort retuned by Tim Peters.
1998-04-28 13:17:56 +00:00
Guido van Rossum
d30dc0a55e
Clear the error condition set by ftell().
1998-04-27 19:01:08 +00:00
Guido van Rossum
565798d493
Be less naive about null characters in an object's repr().
1998-04-21 22:25:01 +00:00
Guido van Rossum
eb90946978
Some robustness checks in Py_ReprLeave() in the unlikely event someone
...
has messed with the dictionary or list.
1998-04-11 15:17:34 +00:00
Guido van Rossum
fb376dee55
Use Py_Repr{Enter,Leave} to display recursive lists in finite space.
...
(Jeremy will hardly recognize his patch :-)
1998-04-10 22:47:27 +00:00
Guido van Rossum
255443b720
Use Py_Repr{Enter,Leave} to display recursive dictionaries in finite space.
...
(Jeremy will hardly recognize his patch :-)
1998-04-10 22:47:14 +00:00
Guido van Rossum
8661036cb8
Add implementations of Py_Repr{Enter,Leave}.
...
(Jeremy will hardly recognize his patch :-)
1998-04-10 22:32:46 +00:00
Guido van Rossum
1109fbca76
Make new gcc -Wall happy
1998-04-10 22:16:39 +00:00
Guido van Rossum
c3d3f9692d
Add PyObject_Not().
1998-04-09 17:53:59 +00:00
Guido van Rossum
f7d590c93d
This was the reason a numeric array to a real power was not working.
1998-04-03 23:38:59 +00:00
Guido van Rossum
240c35aac0
Subtle fix in the read() code which could cause a read broken up in
...
several pieces to fail...
1998-03-18 17:59:20 +00:00
Guido van Rossum
f8b4de02a4
When we have no setvbuf(), make the file totally unbuffered using
...
setbuf() if a buffer size of 0 or 1 byte is requested.
1998-03-06 15:32:40 +00:00
Guido van Rossum
dcb5e7f389
Of course, I shouldn't have used lseek() to find out the file's
...
position in new_buffersize(); the correct function to use is ftell().
Thanks to Ben Jackson.
1998-03-03 22:36:10 +00:00
Guido van Rossum
044b9dc1d7
Add back some safeguards on the index elements that were lost in the
...
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)
1998-02-25 17:50:03 +00:00
Guido van Rossum
f1dc0615e9
Add internal routine _PyModule_Clear(), which does approximately what
...
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).
1998-02-19 20:51:52 +00:00
Guido van Rossum
bde6ff7984
Vladimir Marangozov' performance hack: copy f_builtins from ancestor
...
if the globals are the same.
Also, when creating a dummy builtins dictionary, add "None" to it,
just to be kind.
1998-02-19 20:48:26 +00:00
Guido van Rossum
3da3fcef96
Check ferror(), not errno, for fread() error.
1998-02-19 20:46:48 +00:00
Guido van Rossum
db9351643d
Instead of "attribute-less object", issue an error message that
...
contains the type of the object and name of the attribute.
1998-01-19 22:16:36 +00:00
Guido van Rossum
24e62e2c7c
Modified quicksort by Raymund Galvin, after studying the GNU libg++
...
quicksort. This should be much faster if there are lots of
duplicates, and otherwise at least as good.
1997-12-10 15:14:24 +00:00
Guido van Rossum
b7f1afe4a8
Change the default repr() and str() of class instance objects to look
...
like <modulename.classname instance at ...> (to match the repr() of
class objects.
1997-12-03 00:06:02 +00:00
Guido van Rossum
242c64256c
Add a new function PyNumber_CoerceEx() which works just like
...
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.
1997-11-19 16:03:17 +00:00